Indexing, columnstore and preaggregation
Physical structures, query coverage and execution-driven automatic tuning.
Physical structure selection
A B-tree index serves selective searches and ordered traversal. A columnstore projection narrows reads to relevant columns. A preaggregate materializes calculation state reusable by eligible queries. Path cost includes structure reads, possible data retrieval and residual calculation. Even a specialized structure must therefore be compared against compressed-scan cost.
Three structures and their costs
B-tree indexes target keys/ranges and may provide traversal order. Columnstore projections avoid reading unused columns. Preaggregates retain reusable calculation state when filters, groups, measures and snapshots are compatible. Structures consume disk and construction/maintenance time; their existence does not force their use.
CREATE INDEX accepts one key and creates no UNIQUE constraint. CREATE COLUMNSTORE INDEX accepts multiple columns. Automatic preaggregates are not created through an assumed CREATE MATERIALIZED VIEW syntax; they are managed by the engine and its learning process.
CREATE INDEX ix_ventes_pays ON dbo.Ventes (Pays);
CREATE COLUMNSTORE INDEX cs_ventes ON dbo.Ventes (Pays, Montant, Jour);Learning and alternative plans
When automatic tuning is enabled, eligible queries are observed and may trigger background builds. First-batch publication participates in learning. Persistent structures may survive restarts; RAM observations are not a durable history. Distinguish background tasks from user SQL in activity monitoring.
The engine compares available paths using estimates. A low-selectivity filter may be cheaper through columns than an index. Exact preaggregates cannot serve incompatible filters/types. Inspect plans, alternatives and actual bytes rather than assuming an existing index is always cheapest.
Compare against a reference
Execution option force_scan, “Ignore optimizations” in Studio, forces a reference path and excludes that execution from learning; it does not purge every RAM cache. Compare results, then metrics under matching conditions. Do not remove structures used by other workloads without measuring effects; experiment on a test database first.