Diagnostics functions in the VGI DuckDB extension
Function category
Diagnostics
2 functionsLook under the hood of a VGI table — its per-column statistics and, for multi-branch tables, the branches it declares.
Signature
Returns
A table with the following columns:
| Column | Type | Description |
|---|---|---|
Column
catalog_name
|
Type
VARCHAR
|
Description Catalog of the multi-branch table. |
Column
schema_name
|
Type
VARCHAR
|
Description Schema of the multi-branch table. |
Column
table_name
|
Type
VARCHAR
|
Description Name of the multi-branch table. |
Column
branch_index
|
Type
BIGINT
|
Description Zero-based index of the branch within the table. |
Column
function_name
|
Type
VARCHAR
|
Description Worker-side function that backs this branch. |
Column
positional_arguments
|
Type
JSON
|
Description Positional arguments bound to the branch, as JSON. |
Column
named_arguments
|
Type
JSON
|
Description Named arguments bound to the branch, as JSON. |
Column
branch_filter
|
Type
VARCHAR
|
Description Filter expression that selects this branch, or NULL when unset. |
Column
table_required_extensions
|
Type
VARCHAR[]
|
Description DuckDB extensions the branch requires to be loaded. |
Column
writable
|
Type
BOOLEAN
|
Description Whether the branch is declared as an INSERT target for multi-branch writes. |
Description
Inspect how each attached VGI table is composed from its underlying worker functions, one row per branch per table across every attached VGI catalog. Shows the function_name, positional/named arguments, branch_filter, and required extensions behind every branch — the multi-branch shape the scan rewriter unions together. Single-branch tables surface as one row with branch_index=0.
SELECT * FROM vgi_table_branches();
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
catalog
|
Type
VARCHAR
|
Mode Positional | Description |
Argument
schema
|
Type
VARCHAR
|
Mode Positional | Description |
Argument
table
|
Type
VARCHAR
|
Mode Positional | Description |
Returns
A table with the following columns:
| Column | Type | Description |
|---|---|---|
Column
column_name
|
Type
VARCHAR
|
Description Name of the column this statistics row describes. |
Column
column_type
|
Type
VARCHAR
|
Description DuckDB type of the column. |
Column
min
|
Type
UNION
|
Description Minimum value DuckDB holds for the column, in the column's own type (NULL when unknown). |
Column
max
|
Type
UNION
|
Description Maximum value DuckDB holds for the column, in the column's own type (NULL when unknown). |
Column
has_null
|
Type
BOOLEAN
|
Description Whether the statistics indicate the column may contain NULLs. |
Column
has_not_null
|
Type
BOOLEAN
|
Description Whether the statistics indicate the column has at least one non-NULL value. |
Column
distinct_count
|
Type
BIGINT
|
Description Approximate number of distinct values (HyperLogLog estimate), or NULL if unavailable. |
Column
contains_unicode
|
Type
BOOLEAN
|
Description For string columns, whether values may contain non-ASCII characters. |
Column
max_string_length
|
Type
UBIGINT
|
Description For string columns, the maximum byte length observed. |
Description
Show the per-column statistics DuckDB holds for a VGI table, identified by catalog, schema, and table name. One row per column, exposing the worker-supplied min/max, null counts, and distinct estimates the optimizer uses to plan queries.
SELECT * FROM vgi_table_statistics('mycatalog', 'main', 'events');