{"slug":"code-halowerk-com-v1-index-suggest-360d8f","title":"Suggest B-tree indexes for your queries from a schema DDL","host":"code.halowerk.com","method":"POST","resource":"https://code.halowerk.com/v1/index-suggest","category":"code","description":"Suggest B-tree indexes for your queries from a schema DDL: equality, range, join and ORDER BY columns per table, checked against existing keys and indexes, with ready CREATE INDEX statements. Parses the schema (CREATE TABLE with inline and table-level keys, CREATE INDEX, pg_dump-style ALTER TABLE ..","price_listed":0.003,"price_asked":null,"state":"effects","state_label":"Not tested: has real-world effects","checks_7d":0,"answered_7d":0,"latency_ms_median":null,"reported_calls_30d":1,"reported_payers_30d":1,"networks":["eip155:8453"],"badge":"unverified","paid_checks_7d":0,"paid_ok_7d":0,"example_input":{"body":{"queries":["SELECT id FROM orders WHERE status = 'open' AND created_at >= $1 ORDER BY created_at"],"schema_ddl":"CREATE TABLE orders (id bigint PRIMARY KEY, customer_id bigint NOT NULL, status text NOT NULL, created_at timestamptz NOT NULL);"},"bodyType":"json","method":"POST","type":"http"},"output_schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"input":{"additionalProperties":false,"properties":{"body":{"additionalProperties":false,"properties":{"dialect":{"default":"postgresql","enum":["postgresql","mysql"],"type":"string"},"queries":{"description":"Queries to support; placeholders ?, $1 or literals.","items":{"maxLength":50000,"minLength":6,"type":"string"},"maxItems":50,"minItems":1,"type":"array"},"schema_ddl":{"description":"CREATE TABLE and CREATE INDEX statements of the relevant tables.","maxLength":1000000,"minLength":10,"type":"string"}},"required":["schema_ddl","queries"],"type":"object"},"bodyType":{"enum":["json","form-data","text"],"type":"string"},"method":{"enum":["POST","PUT","PATCH"],"type":"string"},"type":{"const":"http","type":"string"}},"required":["type","method","bodyType","body"],"type":"object"},"output":{"properties":{"example":{"type":"object"},"type":{"type":"string"}},"required":["type"],"type":"object"}},"required":["input"],"type":"object"},"history":[],"description_full":"Suggest B-tree indexes for your queries from a schema DDL: equality, range, join and ORDER BY columns per table, checked against existing keys and indexes, with ready CREATE INDEX statements. Parses the schema (CREATE TABLE with inline and table-level keys, CREATE INDEX, pg_dump-style ALTER TABLE ... ADD CONSTRAINT; PostgreSQL or MySQL) with an own DDL parser and every query with node-sql-parser (SELECT, UPDATE, DELETE incl. joins, subqueries, CTEs, UNION).","last_updated":"2026-11-20T12:47:41.917Z","schemes":["exact"]}