RefLib

Reference library for AI

Back

postgresql_16:7.1.44.1 Description

PostgreSQL 16 > Reference > SQL Commands > ANALYZE > Description

ANALYZE collects statistics about the contents of tables in the database, and stores the results in the pg_statistic (see postgresql_16:8.2.51) system catalog. Subsequently, the query planner uses these statistics to help determine the most efficient execution plans for queries.

Without a *table_and_columns* list, ANALYZE processes every table and materialized view in the current database that the current user has permission to analyze. With a list, ANALYZE processes only those table(s). It is further possible to give a list of column names for a table, in which case only the statistics for those columns are collected.

When the option list is surrounded by parentheses, the options can be written in any order. The parenthesized syntax was added in PostgreSQL 11; the unparenthesized syntax is deprecated.

Back