get_table_stats
Analyze PostgreSQL table statistics to identify maintenance needs and performance issues. Provides table sizes, row counts, scan ratios, and vacuum timing data for user-created tables.
Instructions
Get detailed statistics for user/client database tables.
Note: This tool analyzes only user-created tables and excludes PostgreSQL system tables (pg_catalog, information_schema, pg_toast). This focuses the analysis on your application's custom tables.
Returns information about:
Table size (data, indexes, total)
Row counts and dead tuple ratio
Last vacuum and analyze times
Sequential vs index scan ratios
Cache hit ratios
This helps identify tables that may need maintenance (VACUUM, ANALYZE) or have performance issues.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| schema_name | No | Schema to analyze (default: public) | public |
| table_name | No | Specific table to analyze (optional, analyzes all tables if not provided) | |
| include_indexes | No | Include index statistics | |
| order_by | No | Order results by this metric | size |