ANALYZE TABLE ... DROP-STATISTIK

Gäller för:ibockad ja Databricks SQL ibockad ja Databricks Runtime 18.1 och senare

Kommandot ANALYZE TABLE … DROP STATISTICS tar bort optimerarstatistik från en Unity Catalog-tabell. Använd det här kommandot för att rensa inaktuell eller felaktig statistik så att frågeoptimeraren inte längre förlitar sig på dem. Information om hur du samlar in ny statistik finns iANALYZE TABLE ... BERÄKNINGSSTATISTIK.

Syntax

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

Parameters

Requirements

  • Tabellen måste vara registrerad i Unity Catalog. När du kör det här kommandot mot en Hive-metaarkivtabell genereras en AnalysisException.
  • Du måste ha MODIFY behörighet i tabellen.

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;