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: nonclustered index
Tips for using indexes in SQL Server 2017 (Part 2)
Tips for using indexes in SQL Server 2017 (Part 2) If you create a composite (multi-column) index, try to order the columns in the key so that the WHERE clauses of the frequently used queries match the column(s) that are leftmost in the index. The order of the columns in a composite (multi-column) index is very important. The index will...
Tips for using indexes in SQL Server 2017 (Part 1)
Tips for using indexes in SQL Server 2017 (Part 1) Create a clustered index for each table. If you create a table without clustered index, the data rows will not be stored in any particular order. This structure is called a heap. Every time data is inserted into this table, the row will be added to the end of the...
Tips for using indexes in SQL Server 2016 (Part 2)
Tips for using indexes in SQL Server 2016 (Part 2) Drop indexes that are not used. Because each index take up disk space and slow down the adding, deleting, and updating of rows, you should drop indexes that are not used. You can use Database Engine Tuning Advisor to identify indexes that are not used in your queries. Keep your...
Tips for using indexes in SQL Server 2016 (Part 1)
Tips for using indexes in SQL Server 2016 (Part 1) Consider creating the columnstore indexes on the memory-optimized tables. Beginning with SQL Server 2016, you can create a memory-optimized table with a columnstore index. You can use the ALTER TABLE ADD INDEX statement to add the columnstore index after the memory-optimized table is created. Create a clustered index for each...
Troubleshooting SQL Server 2014 Indexes (Part 2)
Troubleshooting SQL Server 2014 Indexes (Part 2) If you have problems with SQL Server 2014 indexes, review this troubleshooting checklist to find potential solutions. 1. The error occurs when you try to create indexed view on a partitioned table that has a clustered columnstore index. This is the error message text: “Internal Query Processor Error: The query processor could not […]
Understanding SQL Database Indexes — (Part -1)
Understanding Database Indexes – (Part – 1) Author: Basit A. Farooq Editor’s Note: In this two part article series, you will learn about SQL Server indexes, and how they help to achieve optimal query performance while reducing the overall response time. As databases administrator (DBA) or developer, your one of the most important goal is to ensure that query times […]
Tips for using indexes in SQL Server 2014 (Part 2)
Tips for using indexes in SQL Server 2014 (Part 2) Create a clustered index for each table. If you create a table without clustered index, the data rows will not be stored in any particular order. This structure is called a heap. Every time data is inserted into this table, the row will be added to the end of the...
Tips for using indexes in SQL Server 2014 (Part 2)
Tips for using indexes in SQL Server 2014 (Part 2) Create a clustered index for each table. If you create a table without clustered index, the data rows will not be stored in any particular order. This structure is called a heap. Every time data is inserted into this table, the row will be added to the end of the […]
Tips for using indexes in SQL Server 2014 (Part 1)
Tips for using indexes in SQL Server 2014 (Part 1) Keep your indexes as narrow as possible. Because each index takes 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. Use the WAIT_AT_LOW_PRIORITY option with ALTER INDEX statement....