Skip to main content

What is a Composite Index and when is it used?

Entry MS SQL
Quick Answer A composite index covers multiple columns. Useful when your WHERE clause filters on a combination of columns together. The column order matters รขโ‚ฌโ€ the index is most effective when the leading column appears in the filter. A (LastName, FirstName) index won't help a query filtering only on FirstName.

Answer

A composite index includes multiple columns, used when queries filter or sort using those column combinations.

The order of columns is important because SQL Server can only efficiently use leading key columns.

S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice