Query Insights

Apply an index change (create or drop)

Guardrailed per-index DROP / CREATE on the instance's managed PostgreSQL database — the apply half of index-health. Not a SQL runner: inputs are bare identifiers and a fixed non-unique btree shape, every executed statement is assembled from the database's own quote_ident() tokens, and a refuse-ladder rejects any integrity index (primary/unique/exclusion/constraint-backed/replica-identity/extension-owned/partitioned) and any used index (idx_scan > 0) before execution.

drop_index runs synchronously (DROP INDEX CONCURRENTLY) and returns status: applied.

create_index is validated synchronously and the online build (CREATE INDEX CONCURRENTLY) is handed to a background worker — the endpoint returns HTTP 202 status: accepted. Poll the resolve endpoint (type=index, name=<returned index.name>) until it reports valid: true. btree-only; UNIQUE is not supported in v1.

Key Parameters:

  • id: The instance whose database to change
  • action: create_index or drop_index
post/instances/{id}/index-changes

Request

  • Base URL: https://api.cloudpepper.io
  • URL: https://api.cloudpepper.io/instances/{id}/index-changes
  • Auth: HTTP bearer

Request body

action'create_index' | 'drop_index' required
tablestring

create_index only — the table to index (bare identifier, schema public)

columnsstring[]

create_index only — 1 to 8 distinct columns (bare identifiers)

method'btree'

create_index only — btree is the only supported method in v1

index_namestring

drop_index only — the index to drop (bare identifier, schema public)

Response

drop_index applied (DROP INDEX CONCURRENTLY completed)

object required

Changes

No recorded changes to this operation across all 1 revision of this API.