table_inspector

Beobachtbarkeit der DuckDB-Speicherinterna auf Datenbank-, Tabellen- und Spaltenebene

Maintainer: Andrewtangtang, dentiny

Installation und Laden

INSTALL table_inspector FROM community;
LOAD table_inspector;

Beispiel

-- List all attached persistent databases with file sizes
SELECT * FROM inspect_storage();
-- List all tables with their persisted data size
SELECT * FROM inspect_database();
-- Per-segment storage details for a specific column
SELECT * FROM inspect_column('my_table', 'my_column');
-- High-level storage breakdown
SELECT * FROM inspect_block_usage();

Über table_inspector

Eine DuckDB-Erweiterung, die Beobachtbarkeit der DuckDB-Speicherinterna bereitstellt. Sie hilft Ihnen, die Speichernutzung auf Datenbank-, Tabellen- und Spaltenebene zu verstehen und Probleme wie unerwartete Dateigröße oder schlechte Kompression zu untersuchen.

Hinzugefügte Funktionen

function_name function_type description comment examples
inspect_storage table List all attached persistent databases with file and WAL sizes Returns database_name, database_file_bytes, and wal_file_bytes for each non-system, non-temporary, non-in-memory attached database [SELECT * FROM inspect_storage();]
inspect_database table List all tables with persisted data and index sizes Calculates data size by counting unique persistent block IDs per table, and index size from ART allocator buffers [SELECT * FROM inspect_database();]
inspect_column table Show per-segment storage details for a column Returns row_group_id, compression type, compressed_bytes, estimated_decompressed_bytes, and row_count for each segment [SELECT * FROM inspect_column(‘mytable’, ‘mycolumn’);]
inspect_block_usage table Show storage breakdown by component Breaks down a .duckdb file into table_data, index, metadata, and free_blocks with size_bytes, percentage, and block_count [SELECT * FROM inspect_block_usage();]

Überladene Funktionen

Diese Erweiterung fügt keine Funktionsüberladungen hinzu.

Hinzugefügte Typen

Diese Erweiterung fügt keine Typen hinzu.

Hinzugefügte Einstellungen

Diese Erweiterung fügt keine Einstellungen hinzu.