UAE · ENBook a demo
Procure AIEngineeringDecision-maker

Database Agent

Manages schemas, migrations and query performance.

Database AgentApplication Engineering
Industry
Procure AI
Department
Engineering
Team
Application Engineering
Kind
Decision-maker
Approver
Lead DBA
Code
ENG-07

It designs schema changes and migrations for the platform's transactional stores (requisitions, POs, receipts, invoices, contracts, supplier master), reviews slow queries such as match lookups and spend reports, and plans each step for lock time, table size and rollback. It decides whether a migration runs online now, waits for the maintenance window clear of client payment runs and month-end, or must be split.

How it works

7 steps, and a person signs off before step 7.

  1. 01Looks it up

    Finds the record the request is about in the database's catalogue and query statistics: the table sizes, existing indexes, lock waits, replica lag and slowest query statistics for the database named, and the payment-run calendar..

  2. 02Reads the request

    Works out what is being asked and what a complete answer needs.

  3. 03Checks the facts

    Checks figures, dates and rules against the source records, not from memory.

  4. 04Forecasts, when it decides

    Projects what each option will cost or return before it recommends one.

  5. 05Works it through

    Prepares the draft, match, recommendation or reply, with its sources.

  6. 06Asks a person

    Hands the work to Lead DBA with its reasoning before anything goes out.

  7. 07Acts

    Once approved, it acts in the migration tool: it schedules the approved migration steps for the chosen window. and records what was done.

What it works with

Your knowledge, your systems, your people.

Knows

The database standards: naming and type conventions (exact decimals for money, tenant id on every table), the expand-and-contract playbook, the index policy, maintenance windows, the month-end and payment-run blackout calendar, and the retention rules for financial records.

Reads from

the database's catalogue and query statistics: the table sizes, existing indexes, lock waits, replica lag and slowest query statistics for the database named, and the payment-run calendar.

Acts in

the migration tool: it schedules the approved migration steps for the chosen window.

Hands back

An object with steps (a list, each with order, change, online true or false, expected_lock_seconds, reversible true or false and rollback), run_when (now, maintenance_window or split), index_proposals (a list, each with table, columns, reason and expected_gain_ms), pre_checks (a list) and data_risks (a list).

Asks a person when

The plan drops or rewrites financial data, holds a lock longer than 3 seconds, runs on a table above 20000000 rows, or runs in production outside Sunday 02:00 to 04:00 UTC, except the last three and first two working days of the month.

ApproverLead DBA

Settings

Your limits, set by your managers.

SettingDefaultWhat it controls
Longest blocking lock allowed online (s)3A step expected to hold a blocking lock longer is not run online; a lock on invoices blocks matching.
Rows that make a table large20000000Tables above this get batched backfills and online index builds.
Slow query threshold (ms)500A query slower than this on average is reviewed.
Maintenance windowSunday 02:00 to 04:00 UTC, except the last three and first two working days of the monthWhen steps that cannot run online are scheduled; month-end close is excluded.
Wait before dropping (days)30A column or table is dropped only this long after the code stops using it.
Retention for financial records (years)7PO, invoice, payment and audit-trail rows younger than this are never dropped or truncated.

Limits are settings, not code: a manager changes them without a developer.

Rules it always follows

  • Plan every change as expand and contract: add, backfill, switch the code, then remove; each step is reversible or says why not.
  • A step expected to hold a blocking lock longer than 3 seconds is split or scheduled in Sunday 02:00 to 04:00 UTC, except the last three and first two working days of the month, and never during a client's payment run.
  • On tables above 20000000 rows, build indexes online and backfill in batches with a pause between.
  • Drop a column or table only 30 days after the code stops using it, after a verified backup, and never drop financial or audit-trail data younger than 7 years.
  • Every new table carries the tenant id and every index used by a tenant query leads with it.
  • Review queries slower than 500 ms and propose an index only when the gain outweighs its write cost on invoice and PO ingestion.
  • Check the latest backup and replica lag before any production step and stop if either is out of policy.

See the Database Agent agent on your own work.

We’ll run it on a sample of your work and show you what your approver would see.

Database Agent · Procure AI | Basinwright Industries