patternsqlMajor
If a database only ever has one insert, is it bad to index every possible column combination?
Viewed 0 times
combinationindexinsertcolumnbadeverydatabasehasonepossible
Problem
I am working on a reporting system that will require large select queries, but is based on a database that is only filled once. The database management system is Microsoft SQL Server 2017. There is probably a better way to design a system like this, but let's approach this theoretically.
Theoretically speaking:
Could indexing every possible column combination have a negative performance impact on a select query?
Theoretically speaking:
- If we have a very large database (150M+ rows on several tables)
- And we can assume the database will only be populated once.
Could indexing every possible column combination have a negative performance impact on a select query?
Solution
Yes, it will influence initial plan compile time as the optimizer will have many extra access paths to the data to consider.
Since you're on SQL Server 2017, loading once, and running reports, why not just use a clustered column store index instead?
That seems to be the ideal solution to your need to index every possible column combination.
Columnstore indexes - Overview
Since you're on SQL Server 2017, loading once, and running reports, why not just use a clustered column store index instead?
That seems to be the ideal solution to your need to index every possible column combination.
Columnstore indexes - Overview
Context
StackExchange Database Administrators Q#209583, answer score: 37
Revisions (0)
No revisions yet.