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 2008 Forums
 Transact-SQL (2008)
 SQL query performance challenge

Author  Topic 

kcarbone1970
Yak Posting Veteran

52 Posts

Posted - 2015-01-09 : 16:19:18
Hello i have a large cte query that queries hundreds of thousands of records and the wait time is around 40 seconds. I've heard of ways to run the query before, store it in a temp table, then pull it from there, or something to that effect. Can anyone here offer some insight or recommendations on how to expedite...thanks in advance

Cartesian Yak

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2015-01-09 : 17:09:08
Please post the query, execution plan (xml format) and indexes on the tables so that we can help you.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2015-01-09 : 17:19:08
The query I posted to you now runs in 2 seconds.



Microsoft SQL Server MVP, MCT, MCSE, MCSA, MCP, MCITP, MCTS, MCDBA
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2015-01-09 : 17:19:47
quote:
Originally posted by SwePeso

The query I posted to you now runs in 2 seconds.



Microsoft SQL Server MVP, MCT, MCSE, MCSA, MCP, MCITP, MCTS, MCDBA



Cross-post?

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -