DROP STATISTICS

Removes computed histogram statistics for a Delta table.

Category: statisticsDeltaForge extension

Syntax

DROP STATISTICS FOR TABLE <table>

Description

## Overview DROP STATISTICS removes the computed histogram statistics (created by ANALYZE TABLE) from a Delta table. These statistics are stored as Parquet files in the `_delta_log/_statistics/` directory and are separate from the per-file min/max column statistics embedded in the Delta transaction log. ## Behavior The command scans the `_delta_log/_statistics/` directory for the specified table and deletes all histogram statistics files found there. The result message reports the number of files deleted. The following artifacts are removed: - Column histograms (equi-height, streaming, maxdiff, compressed, hybrid, v_optimal, flat) - Bloom filter indexes associated with the histogram statistics - Top-K frequency data - Correlation matrices (for FLAT method statistics) Per-file min/max statistics in the Delta transaction log are not affected. These inline statistics are managed by the Delta protocol and continue to support data skipping regardless of whether histogram statistics are present. ## Use Cases - **Recomputation**: Drop statistics before recomputing with a different histogram method, bin count, or sample rate. - **Schema evolution**: After significant schema changes (adding or dropping columns), existing statistics may reference stale columns. Drop and recompute to align with the current schema. - **Storage reduction**: Histogram statistics can consume significant storage for wide tables with many columns. Drop them if the query workload does not benefit from histogram-based optimization. ## Access Control | Privilege | Object | Notes | |-----------|--------|-------| | Ownership or write | Table | Required to delete statistics files from the table's metadata directory. | ## Compatibility DROP STATISTICS is a DeltaForge extension. The histogram statistics system extends beyond the standard Delta Lake per-file statistics. Other Delta readers that do not support histogram statistics are unaffected by this command.

Parameters

NameTypeDescription
tableSpecify the name or path of the Delta table whose histogram statistics should be removed. The table must be registered in the session (via CREATE DELTA TABLE or OPEN DELTA TABLE). Fully qualified names (zone.schema.table) are supported.

Examples

-- Remove all histogram statistics from a table
DROP STATISTICS FOR TABLE orders;
-- Drop statistics before recomputing with a different histogram method
DROP STATISTICS FOR TABLE warehouse.sales.transactions;
ANALYZE TABLE warehouse.sales.transactions
  COMPUTE STATISTICS FOR ALL COLUMNS
  METHOD hybrid NUM_BINS 200;
-- Drop statistics to reduce metadata storage overhead
DROP STATISTICS FOR TABLE staging.raw_events;
-- Drop and recompute after significant schema changes
DROP STATISTICS FOR TABLE customers;
ANALYZE TABLE customers COMPUTE STATISTICS FOR ALL COLUMNS;
-- Verify statistics were removed
DROP STATISTICS FOR TABLE orders;
DESCRIBE STATISTICS FOR TABLE orders;

Pitfalls

See Also

Open in interactive docs →   DeltaForge home →