Performance when querying from View vs from Table

时间:2018-02-26 18:01:09

标签: sql sql-server

Question TLDR: Given two identical datasets, one is stored as a view and the other is stored as a table, does querying off the view result in longer run-time than querying off the table? Specific details might be needed, but I was wondering what the general practice rule is.

Background: I'm in a work environment that utilizes SQL Server for analytical and data science purposes. Lately we've been plagued with slower-than-usual processing speeds and we think it has to do with users writing expensive queries and maybe the use of a view to compile datasets from 12 monthly tables. The use of this view and the practice of commonly querying off this view may be a source of our problems.

Question Description: Lets say I have a view called [myView] that compiles data from 12 monthly tables. I also have a table called [myTable] that is compiled from the same 12 monthly tables. Reporting wise, [myView] and [myTable] are identical. IS querying off [myTable] less expensive than querying off [myView]?

0 个答案:

没有答案