{
 "schema": "aiblocks-page/1",
 "id": "agency-engineering-gaussdb-expert",
 "type": "agent",
 "name": "GaussDB query and schema reviewer",
 "summary": "Get a GaussDB query and schema review: distribution keys, slow plans, indexes and storage choices. Bring your SQL, tables and plan output.",
 "headline": "GaussDB query and schema reviewer",
 "subhead": "Share your table designs, a slow query and its plan output, and say which GaussDB you run. It reads the plan, checks distribution keys, indexes and storage choices, and finds what costs the most. You get a ranked list of fixes with checks to run before and after.",
 "job": {
  "id": "build-software",
  "name": "Build and ship software"
 },
 "level": "intermediate",
 "thinking": "high",
 "tested": true,
 "updated": "2026-10-28",
 "first_published": "2026-10-26",
 "inputs": [
  {
   "type": "question",
   "required": true,
   "label": "Question",
   "what": "the problem, decision or piece of work you want help with, and what a good outcome looks like"
  },
  {
   "type": "source_text",
   "required": false,
   "label": "Source text",
   "what": "a long source in full: an article, a video or talk transcript, or notes from a book, with its title, author and link"
  }
 ],
 "outputs": [
  {
   "type": "audit_report",
   "required": true,
   "label": "Audit report",
   "what": "findings with evidence, severity, missing inputs and next actions"
  }
 ],
 "you_give": [
  "Which GaussDB you run: distributed or centralized, and the version",
  "The CREATE TABLE statements, with distribution, partition and storage settings",
  "The slow query and its EXPLAIN ANALYZE output",
  "Table row counts and sizes, and your current indexes",
  "What the app does with the data, such as many small updates or large reports (optional)"
 ],
 "you_get": [
  "A ranked table of findings: what is wrong, how serious, the evidence and the change",
  "A review of each distribution key and whether joins must move data",
  "Index and storage engine advice",
  "A rewritten query or table design where one helps",
  "Notes on making each change safely, with a way to undo it",
  "Checks to run before and after"
 ],
 "use_when": [
  "A query is slow on GaussDB and you have its EXPLAIN ANALYZE output.",
  "You are designing tables for a new GaussDB system and need to pick distribution keys.",
  "Your plan shows Broadcast steps on large tables.",
  "Updates and deletes make tables swell, and you are choosing between Ustore and Astore."
 ],
 "skip_when": [
  "Your database is PostgreSQL, MySQL or Oracle. Use the Database performance analyst.",
  "Your product is GaussDB(DWS), openGauss or GaussDB(for MySQL). This agent covers GaussDB OLTP only.",
  "You need backup, restore or failover plans. Use the Database recovery planner."
 ],
 "output_sample": {
  "input": [
   "Your GaussDB edition and version",
   "Your CREATE TABLE statements",
   "The slow query and its EXPLAIN ANALYZE output",
   "Row counts, sizes and current indexes (optional)"
  ],
  "prerequisites": [
   "Read access to your GaussDB, to run EXPLAIN ANALYZE and copy the output",
   "A copy of the database for testing changes"
  ],
  "output": [
   {
    "name": "Product and setup",
    "contains": "The GaussDB edition and version it assumed, and anything marked MISSING."
   },
   {
    "name": "Findings",
    "contains": "Ranked problems, each with severity, evidence from your plan, a change and a check."
   },
   {
    "name": "Distribution keys",
    "contains": "Each table's key, the joins it serves and whether data must move."
   },
   {
    "name": "Indexes and storage",
    "contains": "Index and Ustore or Astore advice with the reason."
   },
   {
    "name": "Rewrites",
    "contains": "A before and after for each changed query or table."
   },
   {
    "name": "Safe change notes",
    "contains": "What each change costs on a large table and how to undo it."
   },
   {
    "name": "Checks before and after",
    "contains": "What to run to confirm each fix worked."
   }
  ]
 },
 "output_shape": "PRODUCT AND SETUP\n  <GaussDB edition and version> | <distributed or centralized> | MISSING: <list>\n\nFINDINGS (ranked by cost)\n  <rank> | <finding> | <severity> | <evidence from your plan> | <suggested change> | <check still needed>\n\nDISTRIBUTION KEYS\n  <table> | <current key> | <joins it serves> | <data move needed> | <keep or change, with reason>\n\nINDEXES AND STORAGE\n  <table> | <index or storage change> | <why>\n\nREWRITES\n  <query or table> | <before> | <after>\n\nSAFE CHANGE NOTES\n  <change> | <cost on a large table> | <undo step>\n\nCHECKS BEFORE AND AFTER\n  <check> | <how to run it> | <pass means>",
 "how_to_use": [
  "Download the pack from this page and add it to your AI as a skill. If you cannot, open a new chat and paste SKILL.md, then references/source-agent.md.",
  "Say which GaussDB product you run. If you are not sure, your AI asks before it answers.",
  "Paste your table statements, the slow query and the EXPLAIN ANALYZE output. Add row counts if you have them.",
  "Say \"Review this. Ask once if anything is missing. Point each finding to a line in my plan.\"",
  "Read the findings table from the top. Each finding must point to evidence in your own plan. Ask again if one does not.",
  "Try each change on a copy, run EXPLAIN ANALYZE again, then compare. Check unfamiliar syntax in Huawei's GaussDB docs."
 ],
 "checks": [
  "The result addresses your actual task and cites the evidence used.",
  "Examples, role-play experience and targets are kept separate from verified results.",
  "Claims of tests, memory, tool access or completed actions match what actually happened."
 ],
 "next": [
  {
   "name": "Database performance analyst",
   "url": "https://useaiblocks.com/skills/agency-engineering-database-optimizer",
   "why": "Build it"
  }
 ],
 "source": {
  "by": "Michael Sitarzewski and Agency Agents contributors",
  "repo": "msitarzewski/agency-agents",
  "url": "https://github.com/msitarzewski/agency-agents/blob/b37b5bb33b78f2c1d6567d98e25ca818e3259219/engineering/engineering-gaussdb-expert.md",
  "licence": "MIT",
  "original_name": "GaussDB Expert Engineer",
  "commit": "b37b5bb33b78f2c1d6567d98e25ca818e3259219"
 },
 "credits": [
  {
   "title": "GaussDB Expert Engineer",
   "by": "Michael Sitarzewski and Agency Agents contributors",
   "url": "https://github.com/msitarzewski/agency-agents/blob/b37b5bb33b78f2c1d6567d98e25ca818e3259219/engineering/engineering-gaussdb-expert.md",
   "used": "Original agent profile, preserved in references/source-agent.md; AI Blocks adds setup and review instructions."
  }
 ],
 "files": [
  "LICENSE",
  "references/source-agent.md",
  "SETUP.md",
  "source.json"
 ],
 "links": {
  "page": "https://useaiblocks.com/agents/agency-engineering-gaussdb-expert",
  "markdown": "https://useaiblocks.com/agents/agency-engineering-gaussdb-expert.md",
  "json": "https://useaiblocks.com/agents/agency-engineering-gaussdb-expert.json",
  "instructions": "https://useaiblocks.com/skills/agency-engineering-gaussdb-expert/SKILL.md",
  "download": "https://useaiblocks.com/skills/agency-engineering-gaussdb-expert.zip",
  "api_item": "https://useaiblocks.com/api/v1/items/agency-engineering-gaussdb-expert",
  "api_document": "https://useaiblocks.com/api/v1/documents/agent/agency-engineering-gaussdb-expert",
  "mcp": "https://useaiblocks.com/mcp"
 }
}
