ANALYZE TABLE ... HAPUS STATISTIK

Berlaku untuk:dicentang ya Databricks SQL dicentang ya Databricks Runtime 18.1 ke atas

Perintah ANALYZE TABLE … DROP STATISTICS menghapus statistik pengoptimal dari tabel Katalog Unity. Gunakan perintah ini untuk menghapus statistik yang basi atau salah sehingga pengoptimal kueri tidak lagi bergantung padanya. Untuk mengumpulkan statistik baru, lihat ANALYZE TABLE ... STATISTIK KOMPUTASI.

Syntax

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

Parameters

Requirements

  • Tabel harus terdaftar di Katalog Unity. Menjalankan perintah ini terhadap tabel metastore Apache Hive meningkatkan AnalysisException.
  • Anda harus memiliki MODIFY hak istimewa di atas meja.

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;