Tips for using indexed views in SQL Server 2019 Avoid creating indexes on a view when the queries that use the view don’t contain JOINs or aggregations. In this case, the queries will not take advantages of the view’s indexes and the queries performance will be the same. Don’t create index on column(s) which values has low selectivity. For example,...
Tag: NOEXPAND
Tips for using table hints in SQL Server 2017
Tips for using table hints in SQL Server 2017 If you want to set any table hints, do not remember to test the query with hint and without the hint and compare results. Because SQL Server 2017 query optimizer usually proposes the best execution plan, you should test the query with table hint and use this hint only when it...
Tips for using indexed views in SQL Server 2017
Tips for using indexed views in SQL Server 2017 Keep the indexes on the views as narrow as possible. Because each index takes up disk space try to minimize the index key’s size to avoid using superfluous disk space. This reduces the number of reads required to read the index and boost overall index performance. Try to create indexes on...
Some tips for using indexed views in SQL Server 2016
Some tips for using indexed views in SQL Server 2016 Consider creating two or more smaller views instead of creating a single large indexed view. Sometimes it can greatly improve performance especially if the underlying tables are located in different databases. Add an index to a view very carefully. When the underlying tables of the view are modified, the clustered […]