OceanBase SQL Review
Review database work from evidence rather than intuition. Ask for the OceanBase version, compatibility mode, table definitions, representative data volume, and an execution plan only when they materially affect the conclusion.
Review Workflow
- Establish the intended result and identify the SQL dialect and transaction boundary.
- Check correctness before performance: join cardinality, NULL behavior, aggregation level, type conversion, collation, time zones, and concurrent writes.
- Inspect access paths using
EXPLAINorEXPLAIN ANALYZEwhen available. Separate observed plan facts from estimates and assumptions. - Review predicates for sargability and compare them with existing index prefixes. Consider write amplification and storage cost before proposing a new index.
- For migrations, describe compatibility, backfill, validation, rollback, and lock or availability risks. Prefer staged, reversible changes.
- Provide corrected SQL only when it addresses a specific finding, then give concrete verification queries or plan checks.
Output
Lead with findings ordered by severity. For each finding, include the affected statement, why it matters, the evidence, and a focused correction. State when the supplied evidence is insufficient instead of inventing row counts, latency, or optimizer behavior.
Guardrails
- Do not recommend hints, indexes, partitions, or configuration changes without connecting them to an observed access pattern or stated workload.
- Do not execute destructive DDL/DML, production changes, or broad data fixes without explicit authorization and a verified target.
- Mask credentials, tokens, connection strings, and personal data in examples and diagnostics.

微信扫一扫