LucidDbAnalyzeTable

From LucidDB Wiki
Jump to: navigation, search

Syntax

ANALYZE TABLE qualified-table-name
COMPUTE STATISTICS FOR { ALL COLUMNS | COLUMNS ( unqualified-column-name, ... ) }
ANALYZE TABLE qualified-table-name
ESTIMATE STATISTICS FOR { ALL COLUMNS | COLUMNS ( unqualified-column-name, ... ) }
[ SAMPLE p PERCENT ]

Usage

See TableStatistics.

It is important to note that running ANALYZE TABLE does not go and create indexes on any columns. It calculates statistics for the query optimization engine to use. You should use this command after everything is in place, (data tables and indexes). If you forget and go out of order and ANALYZE first, then create some new indexes, the query engine will not use your new indexes because no statistics exist describing the usefulness of the new indexes.

Example

ANALYZE TABLE calendar_dimension COMPUTE STATISTICS FOR ALL COLUMNS;
ANALYZE TABLE calendar_dimension ESTIMATE STATISTICS FOR ALL COLUMNS;
Personal tools
Product Documentation