pg_manage_indexes
Simplify PostgreSQL index management: list, create, drop, reindex, and analyze usage for optimized database performance. Supports concurrent operations and detailed usage insights.
Instructions
Manage PostgreSQL indexes - get, create, drop, reindex, and analyze usage with a single tool. Examples: operation="get" to list indexes, operation="create" with indexName, tableName, columns, operation="analyze_usage" for performance analysis
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cascade | No | Include CASCADE clause (for drop operation) | |
| columns | No | Column names for the index (required for create operation) | |
| concurrent | No | Create/drop index concurrently (for create/drop operations) | |
| connectionString | No | PostgreSQL connection string (optional) | |
| ifExists | No | Include IF EXISTS clause (for drop operation) | |
| ifNotExists | No | Include IF NOT EXISTS clause (for create operation) | |
| includeStats | No | Include usage statistics (for get operation) | |
| indexName | No | Index name (required for create/drop) | |
| method | No | Index method (for create operation, defaults to btree) | |
| minSizeBytes | No | Minimum index size in bytes (for analyze_usage operation) | |
| operation | Yes | Operation: get (list indexes), create (new index), drop (remove index), reindex (rebuild), analyze_usage (find unused/duplicate) | |
| schema | No | Schema name (defaults to public) | |
| showDuplicates | No | Detect duplicate indexes (for analyze_usage operation) | |
| showUnused | No | Include unused indexes (for analyze_usage operation) | |
| tableName | No | Table name (optional for get/analyze_usage, required for create) | |
| target | No | Target name for reindex (required for reindex operation) | |
| type | No | Type of target for reindex (required for reindex operation) | |
| unique | No | Create unique index (for create operation) | |
| where | No | WHERE clause for partial index (for create operation) |