← All tips
intermediate·
query-storeperformance

Turn on Query Store before the next incident

Enable Query Store with sensible defaults so the next performance regression is diagnosable.

If Query Store is off, you lose the best flight recorder SQL Server has for plan regressions.

ALTER DATABASE [YourDatabase]
SET QUERY_STORE = ON (
    OPERATION_MODE = READ_WRITE,
    MAX_STORAGE_SIZE_MB = 1000,
    QUERY_CAPTURE_MODE = AUTO
);

Then verify:

SELECT actual_state_desc, readonly_reason, current_storage_size_mb, max_storage_size_mb
FROM sys.database_query_store_options;

Tips:

  • Size storage for workload (1 GB is only a starting point)
  • Do not leave it in read-only because the store filled up — alert on that
  • Use it to compare plans before/after releases and stats changes
  • Pair with wait stats for a complete story

Enabling Query Store is one of the highest-ROI “do it this week” tasks for production databases.

Want this applied to your estate?

We help South African teams implement maintenance and performance improvements properly.

Talk to us