get_table_stats
Analyze MySQL table statistics to identify optimization needs like index improvements, table fragmentation, and partitioning opportunities by examining size, row counts, and index information.
Instructions
Get detailed statistics for MySQL user tables.
Returns information about:
Table size (data, indexes, total)
Row counts and average row length
Index information
Auto-increment values
Table fragmentation
Engine type and collation
Helps identify tables that may need:
Optimization (OPTIMIZE TABLE)
Index improvements
Partitioning consideration
Note: This tool only analyzes user/custom tables and excludes MySQL system tables (mysql, information_schema, performance_schema, sys).
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_table_stats"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| schema_name | No | Schema/database to analyze (uses current database if not specified) | |
| table_name | No | Specific table to analyze (analyzes all tables if not provided) | |
| include_indexes | No | Include index statistics | |
| order_by | No | Order results by this metric | size |