Engineering role

AI Database Optimizer

An AI Postgres tuner that reads the query plan, finds the missing index or the N+1, and proves the fix on a branch before you ship it.

Give it a slow endpoint, a query or a schema and it does the patient work of database tuning: reading the code that issues the queries, running EXPLAIN ANALYZE on a Neon branch or a development Supabase database, spotting the sequential scan, the unindexed foreign key or the query in a loop, and writing the index, the rewrite or the migration that fixes it — with the before-and-after plan to show it worked.

Things you could ask for

Written the way you would actually say them. The agent plans the steps itself.

  • “This endpoint takes two seconds. Read the handler, find the queries it runs, and run EXPLAIN ANALYZE on each against our Neon branch.”
  • “List every foreign key in our schema that has no index, and write the migration to add them without locking the tables.”
  • “Read the order-history page’s code and tell me whether it has an N+1 problem, then rewrite it as one query.”
  • “Our users table is 40 million rows. Propose a partial or composite index for the three queries we run most, and show the plan for each before and after.”
  • “Review this migration before we run it on production: what does it lock, for how long, and how do we roll it back?”

What you get back

Query plans with the slow node called out, index and rewrite proposals as SQL with the measured before-and-after, migrations written to avoid long locks with a rollback for each, and code changes as diffs for the query that caused the problem.

Where it is the wrong tool

  • Keep it on a branch or a development database. The Neon and Supabase connectors run SQL, and EXPLAIN ANALYZE actually executes the query — fine on a copy, not something to point at production writes.
  • It works on Postgres. There is no MySQL, SQL Server or MongoDB connector, so for those it can read the schema and queries you share and reason about them, but cannot run a plan.
  • A branch is not production load. Timings on a quiet copy show whether a plan is better, not how it behaves under real concurrency; confirm with your production metrics after release.
  • It cannot run a load test or reach a database that is not connected. A remote agent has no shell in the cloud; a local agent with shell access in the desktop app can run tools like pgbench on your machine.

Starting an agent with this role

  1. 1Create a Burrak account — any plan works, and your first week is $1.
  2. 2In the Marketplace, open the Roles tab, find Database Optimizer and choose “Start an agent as Database Optimizer”. That creates a remote agent with the role’s instructions in its system prompt.
  3. 3Connect the tools it needs — Neon, Supabase, GitHub, GitLab, Sentry, Grafana — from Connectors.
  4. 4Give it a brief. It keeps working in the cloud after you close the tab, and you are only charged while it is actually working.

The Database Optimizer role, in practice

Is it safe to connect our database?
Connect a Neon branch, a development database or a read replica — never production with write access. Branches exist for exactly this: a full copy of your schema and data that the agent can index, query and throw away.
How is this different from the Backend Architect?
The Backend Architect designs the system — services, APIs, how data moves. The Database Optimizer goes one level down into a single database: plans, indexes, locks and queries. Use the architect when the shape is wrong and the optimizer when the shape is right but slow.
Will it just add indexes everywhere?
No. Every index slows writes and takes space, so each proposal comes with the query it serves and the plan that proves it. It will also point out indexes that are never used and could be dropped.

Capability reference

Summarised from the role’s instructions, which are adapted from the agency-agents collection (AgentLand Contributors), used under the MIT licence.

  • PostgreSQL query plans read with EXPLAIN ANALYZE
  • Indexing strategies: B-tree, GIN, GiST, partial and composite
  • N+1 query detection and rewrites
  • Connection pooling with PgBouncer and the Supabase pooler
  • Zero-downtime migrations that are reversible
Your first 7 days for $1

Your AI assistant is waiting.
Put it to work today.

Put an agent on the work that never needed a human in the first place — the research, the reports, the follow-ups — and take the week back.

$1 for your first week · Cancel anytime · Works on Mac, Windows, iPhone, Android & Web