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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Select query too slow on view vs actual table
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Aged Yak Warrior

567 Posts

Posted - 04/26/2013 :  16:07:32  Show Profile  Reply with Quote
I have a view which is created off of another view in same database, when i run the query on the first view the result is fast.

But when i run the query off of second view, It is taking huge amt of time.

Any reason why the second view is taking a lot of time, i am only doing top 100 rows.

Thanks a lot for the helpful info.

Most Valuable Yak

15732 Posts

Posted - 04/26/2013 :  16:21:02  Show Profile  Visit robvolk's Homepage  Reply with Quote
Without the definition of either view, plus the underlying tables, and the kinds of queries you're writing against them, there's no way to know. Generally speaking however, nesting view references is not a good idea for performance.
Go to Top of Page

Very Important crosS Applying yaK Herder

52326 Posts

Posted - 04/29/2013 :  00:58:47  Show Profile  Reply with Quote
why do you need a separate view for just taking top 100?

SQL Server MVP
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000