Skip to content

Drop indexes api

  • Drop one or more indexes of a table by name with the drop-indexes system API. From custom code, use g.sys.system.dropIndexes.

Request Method: POST

URL

/api/system-api/user-path/drop-indexes

Request payload

  • One table, or a list of tables.
{
    "instance": "mysql8",
    "database": "inventory",
    "table": "orders",
    "indexes": ["am_ix_orders_customer_id_status_3f9a1c", "old_idx_status"],
    "ifExists": true,
    "continueOnError": true
}
Property Required Meaning
instance yes Instance name, crm::acme for a tenant of a multi-tenant instance.
database yes Database name, as the account sees it.
collection or table yes The table.
indexes yes The names to drop.
ifExists no, true A name the table does not have is NOT_FOUND. false : it is FAILED.
continueOnError no, true A drop the database refuses is FAILED and the next ones go on. false : the call fails at the first one.

Response

  • One result per name. The fields of a dropped index are the ones it had.
{
    "success": true,
    "statusCode": 200,
    "data": [
        {
            "instance": "mysql8",
            "database": "inventory",
            "collection": "orders",
            "name": "am_ix_orders_customer_id_status_3f9a1c",
            "fields": ["customer_id", "status"],
            "status": "DROPPED"
        },
        {
            "instance": "mysql8",
            "database": "inventory",
            "collection": "orders",
            "name": "old_idx_status",
            "fields": [],
            "status": "NOT_FOUND",
            "message": "The index \"old_idx_status\" does not exist."
        }
    ],
    "errors": []
}
  • Every drop is logged in the index logs of Index Maker with its source.