• John Deupree (5/2/2014)


    I’m working on a legacy DB and I notice that several of the procedures do joins on views. Some of these views were created on very wide tables to reduce the number of columns returned and reference just the one table. Other views do joins against multiple tables. The query plans of the procedures indicate that, most of the time but not always, the views are using the indexes of the underlying tables. Can someone comment on the performance implications of using views as opposed to the tables themselves.

    TIA

    A view will use the same indexes. There may be something in the view or the queries joining to them that prevents some indexes from being used. From just a performance perspective there is no difference between using a view instead of a table.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/