Understand and control how statistics affect the cost model used by Firebolt’s cost-based optimization rules.
EXPLAIN command with the statistics option.
The following code snippet shows the logical profiles of a simple query:
StoredTable node has metadata source, reflecting the fact that the row count estimate was obtained the metadata served by the storage manager.
The value (2880400) accurately reflects the current number of records in the store_sales table.estimated source.Filter node reflects the fact that after applying the ss_item_sk = 42 filter, the number distinct ss_item_sk will be 1.Sort node (which also applies the limit 10 clause) reflects the fact that the number of output rows will be 10.Projection nodes inherit the profiles of their inputs.enable_storage_statistics session parameter.
Here is an example that uses the same query as above in a session context where enable_storage_statistics is set to false.
Observe that the logical profile of the StoredTable node now has source hardcoded, and the estimated number of rows is 100 million.