Skip to main content

Description

Complete analysis of a single table including: columns with types, nullability, defaults, and comments; column-level statistics from pg_stats (cardinality classification, null rates, enum-like values with frequencies, value ranges for dates/numbers); primary keys; foreign keys with referenced tables; indexes; check constraints; row estimate; table size; statistics freshness; sample rows (up to 5); and index usage statistics. Use this to understand a table before writing queries. Pay attention to: foreign keys for JOIN paths; cardinality to know what to GROUP BY vs filter; enum-like columns show the allowed values; value ranges show date spans and numeric scales; null rates help you handle NULLs correctly in filters and JOINs; sample rows to see actual data patterns; and index usage to understand query performance.

Parameters

Response schema

Column object

Column stats object

Foreign key object

Index object

Check constraint object

Index usage object

Example response

Column masking

If a policy file defines column masks, sample rows are automatically masked using the same rules as query results. For example, with email: redact and phone: partial:
This ensures table analysis never leaks PII. See Column Masking for details.

Notes

  • If schema is omitted, Isthmus resolves the table name across all allowed schemas. If the table name is ambiguous (exists in multiple schemas), provide the schema parameter.
  • Column statistics come from pg_stats and require ANALYZE to have run. If stats are unavailable, the stats field is omitted.
  • Cardinality classification thresholds: unique (100% distinct), near_unique (over 90%), high_cardinality (over 200 distinct), low_cardinality (21–200), enum_like (20 or fewer).
  • Sample rows are fetched with LIMIT 5 using a TABLESAMPLE clause when available for performance.
  • Index usage stats come from pg_stat_user_indexes. An index with scans: 0 may be unused and a candidate for removal.
  • The stats_age_warning field appears when the last ANALYZE is older than 7 days or has never been run.