ANALYZE TABLE … DROP STATISTICS

Gilt für:markiert als ja Databricks SQL markiert als ja Databricks Runtime 18.1 und höher

Mit dem ANALYZE TABLE … DROP STATISTICS Befehl werden Optimiererstatistiken aus einer Unity-Katalogtabelle entfernt. Verwenden Sie diesen Befehl, um veraltete oder falsche Statistiken zu löschen, sodass der Abfrageoptimierer sie nicht mehr benötigt. Informationen zum Sammeln neuer Statistiken finden Sie unter ANALYZE TABLE ... COMPUTE STATISTICS.

Syntax

ANALYZE TABLE table_name DROP [ MANUAL | AUTO | ALL ] STATISTICS

Parameter

Requirements

  • Die Tabelle muss im Unity-Katalog registriert sein. Wenn Sie diesen Befehl für eine Hive-Metastore-Tabelle ausführen, wird eine AnalysisException.
  • Sie müssen über Berechtigungen für die Tabelle verfügen MODIFY .

Examples

-- Drop only manual statistics. This is the default behavior.
> ANALYZE TABLE main.sales.orders DROP STATISTICS;

-- Drop only statistics collected by auto-stats or predictive optimization.
> ANALYZE TABLE main.sales.orders DROP AUTO STATISTICS;

-- Drop all statistics for the table.
> ANALYZE TABLE main.sales.orders DROP ALL STATISTICS;