Skip to content
Fourohtwo

Suggest B-tree indexes for your queries from a schema DDL

code.halowerk.com/v1/index-suggest

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 (

BaseAnswering
POSThttps://code.halowerk.com/v1/index-suggest

Uptime100% of 1 check in 30 days

30 days agoToday

Try it

Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.

The response shows up here.

Call it from an agent

import { createPayer } from "fourohtwo";

// One agent key pays USDC on Base or USDG on Robinhood Chain,
// inside the spending rules you set on Fourohtwo.
const pay = createPayer({ privateKey: process.env.AGENT_KEY });
const res = await pay("https://code.halowerk.com/v1/index-suggest", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"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);"}),
});
console.log(await res.json());

Example input

{
  "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);"
}