How to determine Included non-clustered indexes in SQL Server

Aman Raiyyani
How to determine Included non-clustered indexes in SQL Server

Included indexes are a type of non-clustered index in SQL Server that include columns that are not part of the index key. These included columns allow the index to cover more queries and reduce the need for additional index lookups.

Here are a few ways to determine included indexes in SQL Server:

Using sys.index_columns: You can check the included columns of an index by querying the sys.index_columns system catalog view. The included columns will have a value of 1 in the “is_included_column” column.

SELECT name, column_id, is_included_column
FROM sys.index_columns
WHERE object_id = OBJECT_ID('mytable')

Using sys.indexes: You can also check the included columns of an index by querying the sys.indexes system catalog view. The included columns will have a non-NULL value in the “filter_definition” column.

SELECT name, filter_definition
FROM sys.indexes
WHERE object_id = OBJECT_ID('mytable')

Using sp_helpindex: You can use the sp_helpindex stored procedure to check the included columns of an index. The included columns will be listed after the key columns in the “Columns” column.

EXEC sp_helpindex 'mytable'

Using SQL Server Management Studio: You can also check the included columns of an index by opening the table in SQL Server Management Studio, right-clicking on the index, and selecting “Design”. The included columns will be listed under the “Included Columns” section.

It’s worth noting that, included columns are only used when the indexed columns are not enough to cover a query. So, it’s important to monitor the query performance and adjust the indexes accordingly.

Explore our range of trailblazer services

Risk and Health Audit

Get 360 degree view in to the health of your production Databases with actionable intelligence and readiness for government compliance including HIPAA, SOX, GDPR, PCI, ETC. with 100% money-back guarantee.

DBA Services

The MOST ADVANCED database management service that help manage, maintain & support your production database 24×7 with highest ROI so you can focus on more important things for your business

Cloud Migration

With more than 20 Petabytes of data migration experience to both AWS and Azure cloud, we help migrate your databases to various databases in the cloud including RDS, Aurora, Snowflake, Azure SQL, Etc.

Data Integration

Whether you have unstructured, semi-structured or structured data, we help build pipelines that extract, transform, clean, validate and load it into data warehouse or data lakes or in any databases.

Data Analytics

We help transform your organizations data into powerful,  stunning, light-weight  and meaningful reports using PowerBI or Tableau to help you with making fast and accurate business decisions.

Govt Compliance

Does your business use PII information? We provide detailed and the most advanced risk assessment for your business data related to HIPAA, SOX, PCI, GDPR and several other Govt. compliance regulations.

You May Also Like…