Help the optimizer make better choices after major data changes.

Section: Verify usage

Refresh table statistics

sql
sql
ANALYZE TABLE orders;
Explanation

Stale statistics can cause unexpected plans even when a good index exists.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Verify usage
Explain a query
See whether the optimizer chooses your index.
OpenIn sheetsqlsame section
Test with FORCE INDEX
Diagnostic tool for checking alternate index paths.
OpenIn sheetsqlsame section
Create a composite index
Support a filter plus order-by pattern.
OpenIn sheetsql1 tag match
Index a generated column
Practical route for function-based searches.
OpenIn sheetsql1 tag match
Create an invisible index
Test an index without making it visible to the optimizer by default.
OpenIn sheetsql1 tag match
Toggle index visibility
Hide or re-enable an index without dropping it.
OpenIn sheetsql1 tag match