indexes
Manage PostgreSQL database indexes by listing, creating, dropping, analyzing usage, rebuilding, and identifying unused indexes to optimize query performance.
Instructions
Index management: list, create, drop indexes and analyze index usage
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Action: list (all indexes), create (new index), drop (remove index), analyze (index statistics), reindex (rebuild index), unused (find unused indexes) | |
| columns | No | Column names for index (required for create) | |
| indexName | No | Index name (required for drop, reindex) | |
| options | No | Index creation options | |
| schemaName | No | Schema name (default: public) | public |
| tableName | No | Table name (required for create, list by table) |
Input Schema (JSON Schema)
{
"properties": {
"action": {
"description": "Action: list (all indexes), create (new index), drop (remove index), analyze (index statistics), reindex (rebuild index), unused (find unused indexes)",
"enum": [
"list",
"create",
"drop",
"analyze",
"reindex",
"unused"
],
"type": "string"
},
"columns": {
"description": "Column names for index (required for create)",
"items": {
"type": "string"
},
"type": "array"
},
"indexName": {
"description": "Index name (required for drop, reindex)",
"type": "string"
},
"options": {
"description": "Index creation options",
"properties": {
"concurrent": {
"default": false,
"type": "boolean"
},
"ifExists": {
"default": true,
"type": "boolean"
},
"ifNotExists": {
"default": false,
"type": "boolean"
},
"method": {
"enum": [
"btree",
"hash",
"gist",
"spgist",
"gin",
"brin"
],
"type": "string"
},
"unique": {
"default": false,
"type": "boolean"
}
},
"type": "object"
},
"schemaName": {
"default": "public",
"description": "Schema name (default: public)",
"type": "string"
},
"tableName": {
"description": "Table name (required for create, list by table)",
"type": "string"
}
},
"required": [
"action"
],
"type": "object"
}