Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Query Taking longtime

Author  Topic 

swekik
Posting Yak Master

126 Posts

Posted - 2008-08-04 : 13:51:53
Hi,
I running a query which is taking long time in dev,and in production Iam geeting the results in sec.Whats the reason?What do i need to do to run that fast in dev?

swekik
Posting Yak Master

126 Posts

Posted - 2008-08-04 : 14:47:16
When i ran the query execution plan,I am seeing two different plans randomly.Why this kind of peculiar behaviour??Once it is doing nested loops and once its Hash match join.Why it is like that??
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-08-04 : 14:56:34
Because of difference in index in Dev and Prod. Apply same indexes to DEV as well.
Go to Top of Page

swekik
Posting Yak Master

126 Posts

Posted - 2008-08-04 : 16:08:46
There are no indexes on both dev & prd
Go to Top of Page

mcrowley
Aged Yak Warrior

771 Posts

Posted - 2008-08-04 : 16:51:09
usually, the different plans are due to differeing amounts of data between the systems. Update the table statistics in dev. I would not do that in prod, because Prod is already happy.
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-08-04 : 18:17:10
What? no indexes in production.

Are you sure?
Go to Top of Page

swekik
Posting Yak Master

126 Posts

Posted - 2008-08-04 : 18:28:01
They are staging tables,we dont use indexes for staging tables.
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-08-04 : 22:49:29
quote:
Originally posted by swekik

They are staging tables,we dont use indexes for staging tables.


Is this a temp table ? Is there any reason you cannot create indexes for the staging table ?


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -