SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

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

cplusplus
Aged Yak Warrior

531 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.

robvolk
Most Valuable Yak

USA
15635 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

visakh16
Very Important crosS Applying yaK Herder

India
52249 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
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next Topic  
 New 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.06 seconds. Powered By: Snitz Forums 2000