Repeatability
High
Query optimization follows a repeatable diagnostic pattern: inspect schema, run EXPLAIN ANALYZE, identify bottlenecks, propose indexes and rewrites. The structure is consistent even if the specific tables differ each time.
Ambiguity Tolerance
High
Success is binary and measurable: the query either runs in under 3 seconds or it doesn't. There's no subjective taste involved, making it easy for an agent to know when the job is done.
Data & Tool Availability
Medium
The agent needs read access to the database schema, EXPLAIN ANALYZE output, table statistics, and ideally a staging environment to test rewrites. These are obtainable but require deliberate setup and access grants — not guaranteed out of the box.
Error Cost
High
Creating indexes on a 2M+ row production table can lock tables and cause downtime; a poorly rewritten query could silently return wrong revenue figures. Mistakes here are operationally and financially consequential, even if reversible with effort.
Human Judgment Required
Low
Query optimization is largely algorithmic — read the plan, spot the sequential scans and hash joins, fix them. Business logic edge cases in the revenue calculation may need a human sanity check, but the core debugging work does not require intuition or taste.