March 25, 2009 at 9:43 am
I have a Query which runs in Seconds of time for day before yesterday data or before days data ..... but when i ran the same Query for yesterday or Today it keeps on executing ...
can any one please help me out with this ...
is there any way they can keep hold of data other than the table....becoz if i try todays data after two days it takes jus few seconds ...plx help me out...
Thanks,
Chinna
Its the Journey which gives you Happiness not the Destination-- Dan Millman
March 25, 2009 at 9:49 am
Can't really help you based on what you posted. Does the query complete, just not as quickly as for previous day data? You may want to capture and post the actual query execution plan and post it here. You will need to zip the file before posting it.
March 25, 2009 at 9:57 am
Lynn...Actually i wasnt given the Permission to check the Showplan...
and moreover its not from a file when i am querying a DB from two tables its taking more time when i get the data for yesteday or today ..i mean the create_date >= getdate()-1 and create_date <getdate()
but when i execute the same query for create_date >= getdate()-3 and create_date <getdate()-2
its executing forever so i stopped the Query.....I tried for 3 hrs but still its executing.....
Thanks,
Chinna
Its the Journey which gives you Happiness not the Destination-- Dan Millman
March 25, 2009 at 9:59 am
Wat i jus want to know is Is ther any way to hold the data ...or any kind of locks for data ....
Thanks,
Chinna
Its the Journey which gives you Happiness not the Destination-- Dan Millman
March 25, 2009 at 10:01 am
make sure you are updating stastistics. make sure no indexes were dropped by mistake or reindex table that involve.
you cna also run priler to check at what step its hanging.
run sp_who2 to see if its blocked.
from my experiance its mostly statistics that are mess up and yo uhave to update stats on table that are involve.
:crazy: :alien:
Umar Iqbal
March 25, 2009 at 10:01 am
I am assuming you are running your query from Management Studio. Run the query in one tab, and run SP_WHO2 in a second while your first query is active. What you may find is that your query is blocked for some reason, or at least that is what it is sounding like to me at the moment.
March 25, 2009 at 10:08 am
No Lynn...Nothing is Blocking it as there is only one SPID on the DB which i am running and there is nothing other than that ....i ran sp_who2 i got only one SPID....
I am totally confused becoz it never happended before ...i have checked sp_who,,,nolock....and all other ways...i only want to know is there any chance that they can keep hold of the data...
Thanks,
Chinna
Its the Journey which gives you Happiness not the Destination-- Dan Millman
March 25, 2009 at 10:11 am
Without more information there really isn't much more I can do. You may not have the permissions necessary to provide the info needed since you also could not get the execution plan for the query. Is there anyone at your company you can contact for assistance?
March 25, 2009 at 10:14 am
I shall try to do that ...Thankz Lynn..
Thanks,
Chinna
Its the Journey which gives you Happiness not the Destination-- Dan Millman
March 25, 2009 at 6:00 pm
This may not give you the answer, but it could help. Get the estimated execution plan instead of the actual one. I usually prefer to work only with the actual execution plan, but in cases where you can't get it, a query is hanging or running forever, go for the estimated plan. Once you get it, save it as a .sqlplan file, zip it up and post it here. No guarantees, but it should provide a start.
For what it's worth, it sounds like either something changed on your system, or the statistics are out of date or the indexes are fragmented. Also, it's possible that your query aged out of cache and the new plan from the latest execution isn't as good as the old one.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
Viewing 10 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply