Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Index View or Table?
Message
From
10/03/2016 12:06:30
 
General information
Forum:
Microsoft SQL Server
Category:
Indexing
Environment versions
SQL Server:
SQL Server 2008 R2
Miscellaneous
Thread ID:
01632781
Message ID:
01632799
Views:
31
>>Hi,
>>
>>a system I have has a table called Transactions, then a view based on that called viewTransactions and then another view based on the first view called viewTopTransactions.
>>
>>Should I create indexes on the underlying table and that will speed up queries against the views? Or should I create indexes on the views? or should I index both table and views?
>>
>>The queries are like this:
>>
>>SELECT DISTINCT [PNRStatus] FROM [viewTransactions] ORDER BY [PNRStatus]
>
>View from a view is rarely a good idea.
>
>Check this blog post
>
>http://blogs.lessthandot.com/index.php/datamgmt/dbprogramming/t-sql-wednesday-21-t/

Thanks, good to know, However I am just trying to improve things with as little adjustment to the system as possible. If necessary I will change the views but I am really interested in the answer to the question.
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Previous
Reply
Map
View

Click here to load this message in the networking platform