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
 General SQL Server Forums
 New to SQL Server Programming
 Simple query speed issue

Author  Topic 

Mortal Wombat
Starting Member

10 Posts

Posted - 2011-04-07 : 05:57:58
Hi All,

Bit of a request for information on this one. I have written a fairly simple select statement that includes some date comparisons in the WHERE clause and more notably contains a call to a function in my FROM clause.

This function takes in an INT parameter which is the ID of a row in a large table and returns a further INT ID.

I have run this query on a database on SQL 2008 and it takes approximately 1 second to complete. Running the exact same query on an identical copy of the database running on SQL 2005 takes more than 3 hours to complete.

I realise calling functions within a Select statement isn't the most efficient thing to do but I'm stunned at the massive difference between the 2005 and 2008 instances.

Can anyone advise of known reasons for differences between 2005 and 2008 that could cause this or may it be down to some other factor that I'm missing?

Thanks

raghuveer125
Constraint Violating Yak Guru

285 Posts

Posted - 2011-04-07 : 07:08:17
Post your query and how many row exist in your table On (2008 and 2005) using count(*)

Raghu' S
Go to Top of Page
   

- Advertisement -