column_profile
Profiles a column in a PostgreSQL table: returns null percentage, distinct count, top-K values, min/max, and type-aware stats like average, stddev, or length distribution. Uses sampling for large tables to bound latency.
Instructions
Single-pass profile per column: null %, distinct count, top-K values with frequencies, min/max, and type-aware stats (avg/stddev for numeric, length distribution for text, range for temporal). Uses TABLESAMPLE BERNOULLI for tables larger than sample_threshold (default 1M rows) to keep latency bounded. Replaces a dozen separate exploratory queries an AI agent would otherwise run to understand a column's shape.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | ||
| schema | No | public | |
| columns | No | Specific columns to profile (default: all up to 30). | |
| sample_percent | No | ||
| sample_threshold | No | ||
| top_k | No | Top-K values per column (max 25). | |
| server | No | ||
| database | No | ||
| override_schema | No |