UPDATE STATISTICS
UPDATE STATISTICS is a SQL statement in the Indexes category. Updates query optimizer statistics about index/data distribution. Helps the optimizer make better query plans. The syntax is UPDATE STATISTICS table_name [index_name];. It returns statistics updated. A typical example: UPDATE STATISTICS employees; -- Update all statistics on the table UPDATE STATISTICS employees idx_employees_name; -- Update stats for a specific index -- PostgreSQL: ANALYZE employees; A close relative is CREATE INDEX, which creates an index on one or more columns to speed up query performance. A close relative is DROP INDEX, which removes an existing index from a table. A close relative is COMPOSITE INDEX, which an index on multiple columns. Column order matters — queries use leftmost prefix. More about this category: Database indexes — CREATE INDEX, UNIQUE INDEX, COMPOSITE INDEX, DROP INDEX. Related Indexes entries: CREATE INDEX, DROP INDEX, COMPOSITE INDEX, EXPLAIN, FULLTEXT INDEX, SPATIAL INDEX, INCLUDE INDEX (Covering Index), PARTIAL INDEX.