Displays computed histogram statistics metadata for a table, including histogram methods, bin counts, and column coverage.
DESCRIBE STATISTICS <table>
## Overview Displays metadata about the histogram statistics and bloom filter indexes that have been computed for a table via ANALYZE TABLE. This is the primary diagnostic command for understanding what statistics are available to the query optimizer. ## Behavior - The command reads the HistogramStatisticsMetadata domain metadata from the Delta transaction log. - The result includes: column names covered by histograms, the histogram method used, number of bins, sample rate at the time of computation, top-k configuration, and whether bloom filters are configured. - If no statistics have been computed for the table, the result set is empty. - The command is read-only and does not modify the table or its metadata. - Statistics metadata reflects the most recent ANALYZE TABLE run. Historical statistics from prior versions are not shown (use DESCRIBE HISTORY to find the version at which statistics were computed). ## Result Columns The result set contains metadata about each analyzed column, including: - Column name - Data type - Histogram method - Number of bins - Row count sampled - Whether a bloom filter is configured ## Access Control | Privilege | Object | Notes | |-----------|--------|-------| | Read access | Target table | Required to inspect table metadata. | ## Compatibility DESCRIBE STATISTICS is a DeltaForge extension. Standard SQL defines no equivalent command for inspecting optimizer statistics.
| Name | Type | Description |
|---|---|---|
table | Specifies the table name or path for which to display statistics. Supports fully qualified names (zone.schema.table). |
-- View statistics for a table
DESCRIBE STATISTICS orders;
-- View statistics using a fully qualified name
DESCRIBE STATISTICS analytics.sales.transactions;
-- Check statistics after running ANALYZE TABLE
ANALYZE TABLE orders COMPUTE STATISTICS FOR COLUMNS (customer_id, amount);
DESCRIBE STATISTICS orders;