Improving query performance with views

I have a large table with 10 + millions of records in a SQL Server database. The table contains data of a certain type for all 50 states in the USA. So, if I create 50 views, one for each state, from this table, will the query performance from my application be improved? Other offers?

+3
source share
6 answers

No. A view is a macro that expands, so anyway the same table is included in the plan.

If it is not indexed. 50 indexed views are likely to exceed.

50 ( ), .

Edit:

dmv , ,

+8

() - "" "" SELECT, .

- , , .

, , (, ).

, (, ).

+2

:

, , , . , , , ( ).

0

, - . , /, .

0

One simple suggestion:

use [YourDataBase]
select * from sys.dm_db_missing_index_details as ddmid
0
source

This is such a tiny database that if you have performance problems, indexing incorrectly, the database design is poor, or you have developed poorly executed queries. SQL Server can process trillions of records without breaking sweat if they are designed correctly.

BTW views can be Killers performance if you use views that invoke views.

0
source

Source: https://habr.com/ru/post/1764741/


All Articles