[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-cockroachdb-monitoring-background-jobs":3,"mdc--y1zwyt-key":36,"related-org-cockroachdb-monitoring-background-jobs":3035,"related-repo-cockroachdb-monitoring-background-jobs":3196},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":22,"repoUrl":23,"updatedAt":24,"license":25,"forks":26,"topics":27,"repo":31,"sourceUrl":34,"mdContent":35},"monitoring-background-jobs","monitor CockroachDB background job health","Monitors CockroachDB background job health by identifying failed, paused, and long-running jobs using SHOW JOBS and SHOW AUTOMATIC JOBS. Surfaces schema changes, backups\u002Frestores, automatic statistics collection, and SQL stats compaction jobs without DB Console access. Use when investigating schema change delays, failed backups, or automatic job issues.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"cockroachdb","CockroachDB","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fcockroachdb.png",[12,16,19],{"name":13,"slug":14,"type":15},"Operations","operations","tag",{"name":17,"slug":18,"type":15},"Monitoring","monitoring",{"name":20,"slug":21,"type":15},"Database","database",3,"https:\u002F\u002Fgithub.com\u002Fcockroachdb\u002Fclaude-plugin","2026-07-12T07:57:14.907101",null,2,[28,29,8,30],"claude","cockroach-cloud","developer-tools",{"repoUrl":23,"stars":22,"forks":26,"topics":32,"description":33},[28,29,8,30],"CockroachDB development plugin for Claude","https:\u002F\u002Fgithub.com\u002Fcockroachdb\u002Fclaude-plugin\u002Ftree\u002FHEAD\u002Fskills\u002Fcockroachdb-observability-and-diagnostics\u002Fmonitoring-background-jobs","---\nname: monitoring-background-jobs\ndescription: Monitors CockroachDB background job health by identifying failed, paused, and long-running jobs using SHOW JOBS and SHOW AUTOMATIC JOBS. Surfaces schema changes, backups\u002Frestores, automatic statistics collection, and SQL stats compaction jobs without DB Console access. Use when investigating schema change delays, failed backups, or automatic job issues.\ncompatibility: Requires SQL access with VIEWJOB privilege or CONTROLJOB role option for cluster-wide visibility. Uses SHOW JOBS and SHOW AUTOMATIC JOBS (production-safe).\nmetadata:\n  author: cockroachdb\n  version: \"1.0\"\n---\n\n# Monitoring Background Jobs\n\nMonitors background job health by identifying failed, paused, and long-running jobs that are distinct from user queries. Uses SQL-only interfaces (SHOW JOBS and SHOW AUTOMATIC JOBS) to surface schema changes, backups\u002Frestores, automatic statistics collection, and SQL stats compaction without requiring DB Console access.\n\n## Prerequisites\n\n- SQL connection with `VIEWJOB` system privilege (read-only) or `CONTROLJOB` role option (control)\n- Background jobs are excluded from `SHOW CLUSTER STATEMENTS` and from statement statistics surfaced in the DB Console SQL Activity page\n\n**Related skills:** [triaging-live-sql-activity](..\u002Ftriaging-live-sql-activity\u002FSKILL.md) for live queries, [profiling-statement-fingerprints](..\u002Fprofiling-statement-fingerprints\u002FSKILL.md) for historical query analysis.\n\n## Key Interfaces\n\n- `SHOW JOBS`: User-initiated + automatic jobs (last 12h default; retention configurable via the `jobs.retention_time` cluster setting, default 14 days)\n- `SHOW AUTOMATIC JOBS`: Automatic jobs only (AUTO CREATE STATS, SCHEMA CHANGE GC, etc.)\n\nSee [job types reference](references\u002Fjob-types.md) and [job states reference](references\u002Fjob-states.md) for complete catalogs.\n\n## Core Diagnostic Queries\n\n### Query 1: Failed Jobs (Last 12 Hours)\n\nIdentify jobs that failed with error messages:\n\n```sql\n-- Failed jobs in last 12 hours\nWITH j AS (SHOW JOBS)\nSELECT\n  job_id,\n  job_type,\n  description,\n  created,\n  finished,\n  now() - created AS total_duration,\n  error\nFROM j\nWHERE status = 'failed'\n  AND created > now() - INTERVAL '12 hours'\nORDER BY created DESC\nLIMIT 50;\n```\n\n**Key columns:**\n- `error`: Failure reason (check for permission errors, disk space, network issues)\n- `description`: Human-readable description of what the job was doing\n- `total_duration`: How long the job ran before failing\n\n**Common failure patterns:**\n- Permission denied: User lacks required privileges\n- Disk space: Backup destination full\n- Network timeout: External storage unreachable\n- Constraint violation: Restore conflicts with existing data\n\n### Query 2: Long-Running Jobs\n\nFind jobs running longer than expected threshold:\n\n```sql\n-- Jobs running longer than 1 hour\nWITH j AS (SHOW JOBS)\nSELECT\n  job_id,\n  job_type,\n  description,\n  status,\n  running_status,\n  created,\n  now() - created AS running_for,\n  fraction_completed,\n  coordinator_id\nFROM j\nWHERE status = 'running'\n  AND created \u003C now() - INTERVAL '1 hour'\nORDER BY created\nLIMIT 50;\n```\n\n**Key columns:**\n- `running_for`: Total elapsed time since job started\n- `fraction_completed`: Progress estimate (0.0 to 1.0, NULL if unavailable)\n- `running_status`: Sub-state details (e.g., \"waiting for MVCC GC\")\n\n**Customizable thresholds:**\n- Schema changes: 30 minutes to several hours (depends on table size)\n- Backups: 1-6+ hours (depends on data volume)\n- Automatic jobs: Usually \u003C 30 minutes\n\n### Query 3: Paused Jobs\n\nIdentify jobs that are paused and may need attention:\n\n```sql\n-- Paused jobs needing resume\nWITH j AS (SHOW JOBS)\nSELECT\n  job_id,\n  job_type,\n  description,\n  created,\n  now() - created AS paused_for,\n  coordinator_id\nFROM j\nWHERE status = 'paused'\nORDER BY created\nLIMIT 50;\n```\n\n**Action required:**\nResume with `RESUME JOB \u003Cjob_id>` after verifying the pause reason.\n\n**Common reasons for paused jobs:**\n- Manual user pause for maintenance\n- Resource constraints (cluster paused the job)\n- Error requiring manual intervention\n\n### Query 4: Schema Changes Waiting for MVCC GC\n\nFind SCHEMA CHANGE GC jobs waiting for garbage collection:\n\n```sql\n-- Schema change cleanup jobs waiting for GC\nWITH j AS (SHOW JOBS)\nSELECT\n  job_id,\n  job_type,\n  description,\n  created,\n  now() - created AS waiting_for,\n  running_status\nFROM j\nWHERE status = 'running'\n  AND job_type = 'SCHEMA CHANGE GC'\n  AND running_status LIKE '%waiting for MVCC GC%'\nORDER BY created\nLIMIT 50;\n```\n\n**Interpretation:**\n- **Normal:** SCHEMA CHANGE GC jobs wait for data to become garbage-collectable based on the zone-level `gc.ttlseconds` (default 4 hours)\n- **Expected duration:** Up to `gc.ttlseconds` + some overhead\n- **When to worry:** Waiting > 2x `gc.ttlseconds` (check the effective value with `SHOW ZONE CONFIGURATION FOR ...` against the affected table, database, or RANGE — zone configs cascade and may be overridden at any level)\n\n**Why this happens:**\nAfter DROP TABLE\u002FINDEX operations, CockroachDB must wait for all reads at older timestamps to complete before physically removing data. This prevents \"time-travel\" queries from failing.\n\nSee [job states reference](references\u002Fjob-states.md) for detailed MVCC GC explanation.\n\n### Query 5: Automatic Job Health (24h Window)\n\nMonitor automatic background jobs like statistics collection:\n\n```sql\n-- Automatic jobs in last 24 hours\nSELECT\n  job_id,\n  job_type,\n  description,\n  status,\n  created,\n  finished,\n  COALESCE(finished, now()) - created AS duration\nFROM [SHOW AUTOMATIC JOBS]\nWHERE created > now() - INTERVAL '24 hours'\n  AND job_type IN ('AUTO CREATE STATS', 'AUTO SQL STATS COMPACTION')\nORDER BY created DESC\nLIMIT 50;\n```\n\n**Key job types:**\n- `AUTO CREATE STATS`: Automatic table statistics refresh (critical for query optimizer)\n- `AUTO SQL STATS COMPACTION`: Periodic cleanup of statement\u002Ftransaction statistics tables\n\n**Health indicators:**\n- **Healthy:** Regular successful executions (every few hours)\n- **Unhealthy:** No recent executions, or high failure rate\n- **Impact of failure:** Stale statistics lead to poor query plans and slow queries\n\n### Query 6: Jobs by Type and Status\n\nAggregated view for pattern analysis:\n\n```sql\n-- Job distribution by type and status (last 24h)\nWITH j AS (SHOW JOBS)\nSELECT\n  job_type,\n  status,\n  COUNT(*) AS job_count,\n  MIN(created) AS oldest,\n  MAX(created) AS newest\nFROM j\nWHERE created > now() - INTERVAL '24 hours'\nGROUP BY job_type, status\nORDER BY job_type, status;\n```\n\n**Use case:**\n- Identify patterns (e.g., all BACKUP jobs failing, multiple schema changes stuck)\n- Spot anomalies (e.g., unusual job type volume)\n- Track job success rates by type\n\n### Query 7: Backup and Restore Progress\n\nTrack progress of backup\u002Frestore jobs:\n\n```sql\n-- Active backup\u002Frestore jobs with progress\nWITH j AS (SHOW JOBS)\nSELECT\n  job_id,\n  job_type,\n  description,\n  created,\n  now() - created AS running_for,\n  ROUND(COALESCE(fraction_completed, 0) * 100, 2) AS percent_complete,\n  CASE\n    WHEN fraction_completed > 0 AND fraction_completed \u003C 1 THEN\n      ((now() - created) \u002F fraction_completed) - (now() - created)\n    ELSE NULL\n  END AS estimated_time_remaining,\n  running_status\nFROM j\nWHERE status = 'running'\n  AND job_type IN ('BACKUP', 'RESTORE')\nORDER BY created\nLIMIT 50;\n```\n\n**Key columns:**\n- `percent_complete`: Progress percentage (0-100)\n- `estimated_time_remaining`: Rough estimate based on current progress rate\n- `running_status`: Detailed status (e.g., \"performing backup to s3:\u002F\u002F...\")\n\n**Note:** `fraction_completed` may be NULL for some job types or early in execution.\n\n## Common Workflows\n\n### Workflow 1: Schema Change Stuck Investigation\n\n**Scenario:** User reports ALTER TABLE or CREATE INDEX appears stuck.\n\n1. **Check for running schema changes:**\n   ```sql\n   WITH j AS (SHOW JOBS)\n   SELECT job_id, description, created, now() - created AS running_for,\n          fraction_completed, running_status\n   FROM j\n   WHERE status = 'running'\n     AND job_type IN ('SCHEMA CHANGE', 'NEW SCHEMA CHANGE')\n   ORDER BY created;\n   ```\n\n2. **Identify MVCC GC waits:**\n   ```sql\n   -- Use Query 4 to find \"waiting for MVCC GC\" jobs\n   ```\n\n3. **Interpret results:**\n   - If `running_status` = \"waiting for MVCC GC\": Normal for post-DROP cleanup (wait up to `gc.ttlseconds`)\n   - If long-running with low `fraction_completed`: Check for contention, large table size, or resource constraints\n   - If failed: Check `error` column for specific failure reason\n\n4. **Next steps:**\n   - MVCC GC wait: Verify the effective `gc.ttlseconds` with `SHOW ZONE CONFIGURATION FOR TABLE\u002FDATABASE\u002FRANGE ...` against the affected object and wait\n   - Resource constraints: Check cluster CPU\u002Fmemory usage\n   - Failed job: Address error (permissions, constraints) and retry operation\n\n### Workflow 2: Failed Backup Triage\n\n**Scenario:** Scheduled backup job failed.\n\n1. **Find recent failed backups:**\n   ```sql\n   -- Use Query 1 filtered for BACKUP job type\n   WITH j AS (SHOW JOBS)\n   SELECT job_id, description, created, finished, error\n   FROM j\n   WHERE status = 'failed'\n     AND job_type = 'BACKUP'\n     AND created > now() - INTERVAL '24 hours'\n   ORDER BY created DESC;\n   ```\n\n2. **Analyze error messages:**\n   - \"permission denied\": Check external storage credentials\n   - \"timeout\": Network connectivity to backup destination\n   - \"no space left\": Destination storage full\n   - \"connection refused\": External storage endpoint unreachable\n\n3. **Verify backup destination:**\n   ```sql\n   -- Check SHOW BACKUP for successful backups to same destination\n   SHOW BACKUP 's3:\u002F\u002Fbucket\u002Fpath';\n   ```\n\n4. **Remediate and retry:**\n   - Fix underlying issue (credentials, storage, network)\n   - Re-run backup command\n   - Monitor with Query 7 for progress\n\n### Workflow 3: Automatic Job Health Check\n\n**Scenario:** Proactive monitoring of automatic background jobs.\n\n1. **Check AUTO CREATE STATS frequency:**\n   ```sql\n   -- Use Query 5 to see recent automatic statistics jobs\n   SELECT job_type, status, COUNT(*) AS job_count,\n          MAX(created) AS most_recent\n   FROM [SHOW AUTOMATIC JOBS]\n   WHERE created > now() - INTERVAL '24 hours'\n     AND job_type = 'AUTO CREATE STATS'\n   GROUP BY job_type, status;\n   ```\n\n2. **Expected pattern:**\n   - Multiple successful AUTO CREATE STATS jobs per day (depends on table update frequency)\n   - Regular AUTO SQL STATS COMPACTION (typically once per hour)\n\n3. **Warning signs:**\n   - No AUTO CREATE STATS in last 24h: Statistics collection may be disabled\n   - High failure rate: Check cluster resource constraints or permission issues\n   - No AUTO SQL STATS COMPACTION: Stats table may grow unbounded\n\n4. **Verify settings:**\n   ```sql\n   SHOW CLUSTER SETTING sql.stats.automatic_collection.enabled;  -- Should be true\n   SHOW CLUSTER SETTING sql.stats.automatic_collection.min_stale_rows;\n   ```\n\n### Workflow 4: Long-Running Job Monitoring\n\n**Scenario:** Track progress of expected long-running operations.\n\n1. **Identify long-running jobs:**\n   ```sql\n   -- Use Query 2 with custom threshold\n   WITH j AS (SHOW JOBS)\n   SELECT job_id, job_type, description,\n          now() - created AS running_for,\n          fraction_completed\n   FROM j\n   WHERE status = 'running'\n     AND created \u003C now() - INTERVAL '30 minutes'\n   ORDER BY created;\n   ```\n\n2. **Monitor progress over time:**\n   ```sql\n   -- Re-run every 10-15 minutes, track fraction_completed changes\n   -- Example: 0.25 → 0.40 → 0.55 indicates steady progress\n   ```\n\n3. **Estimate completion:**\n   ```sql\n   -- Use Query 7 for backup\u002Frestore jobs with time estimates\n   ```\n\n4. **Decide on action:**\n   - Steady progress: Continue monitoring\n   - Stalled progress (fraction_completed not increasing): Investigate with [triaging-live-sql-activity](..\u002Ftriaging-live-sql-activity\u002FSKILL.md)\n   - Failed: Use Query 1 to check error\n\n## Safety Considerations\n\n**Read-only operations (all diagnostic queries):**\nAll `SHOW JOBS` and `SHOW AUTOMATIC JOBS` queries are read-only and safe to run in production. No performance impact on cluster operations.\n\n**Job control operations (opt-in):**\n\n**CAUTION: Pausing or canceling jobs can have data integrity implications**\n\nOnly proceed with job control if:\n- You have `CONTROLJOB` role option\n- You understand the implications (e.g., canceling a schema change mid-execution may require manual cleanup)\n- You have authorization to interrupt cluster operations\n- You've verified the job is truly problematic (not just slow)\n\n**Job control commands:**\n```sql\n-- Pause a running job (can be resumed later)\nPAUSE JOB \u003Cjob_id>;\n\n-- Resume a paused job\nRESUME JOB \u003Cjob_id>;\n\n-- Cancel a job (terminal - cannot be resumed)\nCANCEL JOB \u003Cjob_id>;\n```\n\n**Risks by job type:**\n- **SCHEMA CHANGE:** Canceling may leave schema in inconsistent state; prefer PAUSE and investigation\n- **BACKUP:** Canceling is safe (can retry); pausing is better for temporary issues\n- **RESTORE:** Canceling may leave database partially restored; requires cleanup\n- **AUTO CREATE STATS:** Canceling is safe (will retry later automatically)\n\n**Best practice:** Focus on monitoring and diagnosis; only use control operations when explicitly required and authorized.\n\nSee [permissions reference](references\u002Fpermissions.md) for CONTROLJOB role option setup.\n\n## Troubleshooting\n\n| Issue | Cause | Fix |\n|-------|-------|-----|\n| `SHOW JOBS` returns empty | No jobs in last 12h, or insufficient privileges | Grant `VIEWJOB` privilege; verify cluster has recent job activity |\n| \"waiting for MVCC GC\" for many hours | Normal behavior for SCHEMA CHANGE GC after DROP operations | Wait up to `gc.ttlseconds` (default 4h); check the effective value with `SHOW ZONE CONFIGURATION FOR ...` against the affected table\u002Fdatabase\u002Frange |\n| Can't pause\u002Fresume job: \"permission denied\" | Missing `CONTROLJOB` role option | Use `ALTER ROLE \u003Cusername> WITH CONTROLJOB` (not GRANT SYSTEM) |\n| Job stuck at same `fraction_completed` | Job may be processing large batch, or actually stuck | Wait 15-30 min and re-check; if no change, investigate with live query triage |\n| No AUTO CREATE STATS jobs | Automatic collection disabled | Check `sql.stats.automatic_collection.enabled = true` |\n| `SHOW AUTOMATIC JOBS` shows old jobs only | Need to filter by time window | Add `WHERE created > now() - INTERVAL '24 hours'` |\n| Failed job with \"schema change GC\" error | Expected for post-DROP cleanup failures | Usually safe to ignore; job will retry automatically |\n| Job error: \"concurrent schema change\" | Multiple schema changes on same table | Wait for first schema change to complete, then retry |\n\n## Key Considerations\n\n- **MVCC GC waiting:** Normal for post-DROP cleanup; duration tied to the zone-level `gc.ttlseconds` (default 4h)\n- **Automatic job health:** Regular AUTO CREATE STATS is critical for query optimizer performance\n- **Job control:** PAUSE is safer than CANCEL; some cancellations require manual cleanup\n- **Progress:** `fraction_completed` may be NULL for some job types\n\n## References\n\n**Skill references:**\n- [RBAC and privilege setup](references\u002Fpermissions.md)\n- [Job states and transitions](references\u002Fjob-states.md)\n- [Job types catalog](references\u002Fjob-types.md)\n- [SQL query variations](references\u002Fsql-query-variations.md)\n\n**Related skills:**\n- [triaging-live-sql-activity](..\u002Ftriaging-live-sql-activity\u002FSKILL.md) - For live query monitoring (job-executed statements may not appear)\n- [profiling-statement-fingerprints](..\u002Fprofiling-statement-fingerprints\u002FSKILL.md) - For historical query analysis (background jobs excluded)\n\n**Official CockroachDB Documentation:**\n- [SHOW JOBS](https:\u002F\u002Fwww.cockroachlabs.com\u002Fdocs\u002Fstable\u002Fshow-jobs.html)\n- [SHOW AUTOMATIC JOBS](https:\u002F\u002Fwww.cockroachlabs.com\u002Fdocs\u002Fstable\u002Fshow-automatic-jobs.html)\n- [PAUSE JOB](https:\u002F\u002Fwww.cockroachlabs.com\u002Fdocs\u002Fstable\u002Fpause-job.html)\n- [RESUME JOB](https:\u002F\u002Fwww.cockroachlabs.com\u002Fdocs\u002Fstable\u002Fresume-job.html)\n- [CANCEL JOB](https:\u002F\u002Fwww.cockroachlabs.com\u002Fdocs\u002Fstable\u002Fcancel-job.html)\n- [crdb_internal](https:\u002F\u002Fwww.cockroachlabs.com\u002Fdocs\u002Fstable\u002Fcrdb-internal.html)\n- [Jobs Page (DB Console)](https:\u002F\u002Fwww.cockroachlabs.com\u002Fdocs\u002Fstable\u002Fui-jobs-page.html)\n- [VIEWJOB privilege](https:\u002F\u002Fwww.cockroachlabs.com\u002Fdocs\u002Fstable\u002Fsecurity-reference\u002Fauthorization.html#supported-privileges)\n",{"data":37,"body":41},{"name":4,"description":6,"compatibility":38,"metadata":39},"Requires SQL access with VIEWJOB privilege or CONTROLJOB role option for cluster-wide visibility. Uses SHOW JOBS and SHOW AUTOMATIC JOBS (production-safe).",{"author":8,"version":40},"1.0",{"type":42,"children":43},"root",[44,52,58,65,105,133,139,172,193,199,206,211,357,365,401,409,432,438,443,580,587,623,631,649,655,660,761,779,787,805,811,816,933,941,1004,1014,1024,1030,1035,1145,1153,1178,1186,1219,1225,1230,1327,1335,1353,1359,1364,1522,1529,1564,1580,1586,1592,1602,1791,1797,1806,1973,1979,1988,2138,2144,2153,2322,2328,2351,2359,2367,2372,2402,2410,2481,2489,2532,2542,2554,2560,2799,2805,2861,2867,2875,2911,2918,2939,2947,3029],{"type":45,"tag":46,"props":47,"children":48},"element","h1",{"id":4},[49],{"type":50,"value":51},"text","Monitoring Background Jobs",{"type":45,"tag":53,"props":54,"children":55},"p",{},[56],{"type":50,"value":57},"Monitors background job health by identifying failed, paused, and long-running jobs that are distinct from user queries. Uses SQL-only interfaces (SHOW JOBS and SHOW AUTOMATIC JOBS) to surface schema changes, backups\u002Frestores, automatic statistics collection, and SQL stats compaction without requiring DB Console access.",{"type":45,"tag":59,"props":60,"children":62},"h2",{"id":61},"prerequisites",[63],{"type":50,"value":64},"Prerequisites",{"type":45,"tag":66,"props":67,"children":68},"ul",{},[69,92],{"type":45,"tag":70,"props":71,"children":72},"li",{},[73,75,82,84,90],{"type":50,"value":74},"SQL connection with ",{"type":45,"tag":76,"props":77,"children":79},"code",{"className":78},[],[80],{"type":50,"value":81},"VIEWJOB",{"type":50,"value":83}," system privilege (read-only) or ",{"type":45,"tag":76,"props":85,"children":87},{"className":86},[],[88],{"type":50,"value":89},"CONTROLJOB",{"type":50,"value":91}," role option (control)",{"type":45,"tag":70,"props":93,"children":94},{},[95,97,103],{"type":50,"value":96},"Background jobs are excluded from ",{"type":45,"tag":76,"props":98,"children":100},{"className":99},[],[101],{"type":50,"value":102},"SHOW CLUSTER STATEMENTS",{"type":50,"value":104}," and from statement statistics surfaced in the DB Console SQL Activity page",{"type":45,"tag":53,"props":106,"children":107},{},[108,114,116,123,125,131],{"type":45,"tag":109,"props":110,"children":111},"strong",{},[112],{"type":50,"value":113},"Related skills:",{"type":50,"value":115}," ",{"type":45,"tag":117,"props":118,"children":120},"a",{"href":119},"..\u002Ftriaging-live-sql-activity\u002FSKILL.md",[121],{"type":50,"value":122},"triaging-live-sql-activity",{"type":50,"value":124}," for live queries, ",{"type":45,"tag":117,"props":126,"children":128},{"href":127},"..\u002Fprofiling-statement-fingerprints\u002FSKILL.md",[129],{"type":50,"value":130},"profiling-statement-fingerprints",{"type":50,"value":132}," for historical query analysis.",{"type":45,"tag":59,"props":134,"children":136},{"id":135},"key-interfaces",[137],{"type":50,"value":138},"Key Interfaces",{"type":45,"tag":66,"props":140,"children":141},{},[142,161],{"type":45,"tag":70,"props":143,"children":144},{},[145,151,153,159],{"type":45,"tag":76,"props":146,"children":148},{"className":147},[],[149],{"type":50,"value":150},"SHOW JOBS",{"type":50,"value":152},": User-initiated + automatic jobs (last 12h default; retention configurable via the ",{"type":45,"tag":76,"props":154,"children":156},{"className":155},[],[157],{"type":50,"value":158},"jobs.retention_time",{"type":50,"value":160}," cluster setting, default 14 days)",{"type":45,"tag":70,"props":162,"children":163},{},[164,170],{"type":45,"tag":76,"props":165,"children":167},{"className":166},[],[168],{"type":50,"value":169},"SHOW AUTOMATIC JOBS",{"type":50,"value":171},": Automatic jobs only (AUTO CREATE STATS, SCHEMA CHANGE GC, etc.)",{"type":45,"tag":53,"props":173,"children":174},{},[175,177,183,185,191],{"type":50,"value":176},"See ",{"type":45,"tag":117,"props":178,"children":180},{"href":179},"references\u002Fjob-types.md",[181],{"type":50,"value":182},"job types reference",{"type":50,"value":184}," and ",{"type":45,"tag":117,"props":186,"children":188},{"href":187},"references\u002Fjob-states.md",[189],{"type":50,"value":190},"job states reference",{"type":50,"value":192}," for complete catalogs.",{"type":45,"tag":59,"props":194,"children":196},{"id":195},"core-diagnostic-queries",[197],{"type":50,"value":198},"Core Diagnostic Queries",{"type":45,"tag":200,"props":201,"children":203},"h3",{"id":202},"query-1-failed-jobs-last-12-hours",[204],{"type":50,"value":205},"Query 1: Failed Jobs (Last 12 Hours)",{"type":45,"tag":53,"props":207,"children":208},{},[209],{"type":50,"value":210},"Identify jobs that failed with error messages:",{"type":45,"tag":212,"props":213,"children":218},"pre",{"className":214,"code":215,"language":216,"meta":217,"style":217},"language-sql shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","-- Failed jobs in last 12 hours\nWITH j AS (SHOW JOBS)\nSELECT\n  job_id,\n  job_type,\n  description,\n  created,\n  finished,\n  now() - created AS total_duration,\n  error\nFROM j\nWHERE status = 'failed'\n  AND created > now() - INTERVAL '12 hours'\nORDER BY created DESC\nLIMIT 50;\n","sql","",[219],{"type":45,"tag":76,"props":220,"children":221},{"__ignoreMap":217},[222,233,241,249,258,267,276,285,294,303,312,321,330,339,348],{"type":45,"tag":223,"props":224,"children":227},"span",{"class":225,"line":226},"line",1,[228],{"type":45,"tag":223,"props":229,"children":230},{},[231],{"type":50,"value":232},"-- Failed jobs in last 12 hours\n",{"type":45,"tag":223,"props":234,"children":235},{"class":225,"line":26},[236],{"type":45,"tag":223,"props":237,"children":238},{},[239],{"type":50,"value":240},"WITH j AS (SHOW JOBS)\n",{"type":45,"tag":223,"props":242,"children":243},{"class":225,"line":22},[244],{"type":45,"tag":223,"props":245,"children":246},{},[247],{"type":50,"value":248},"SELECT\n",{"type":45,"tag":223,"props":250,"children":252},{"class":225,"line":251},4,[253],{"type":45,"tag":223,"props":254,"children":255},{},[256],{"type":50,"value":257},"  job_id,\n",{"type":45,"tag":223,"props":259,"children":261},{"class":225,"line":260},5,[262],{"type":45,"tag":223,"props":263,"children":264},{},[265],{"type":50,"value":266},"  job_type,\n",{"type":45,"tag":223,"props":268,"children":270},{"class":225,"line":269},6,[271],{"type":45,"tag":223,"props":272,"children":273},{},[274],{"type":50,"value":275},"  description,\n",{"type":45,"tag":223,"props":277,"children":279},{"class":225,"line":278},7,[280],{"type":45,"tag":223,"props":281,"children":282},{},[283],{"type":50,"value":284},"  created,\n",{"type":45,"tag":223,"props":286,"children":288},{"class":225,"line":287},8,[289],{"type":45,"tag":223,"props":290,"children":291},{},[292],{"type":50,"value":293},"  finished,\n",{"type":45,"tag":223,"props":295,"children":297},{"class":225,"line":296},9,[298],{"type":45,"tag":223,"props":299,"children":300},{},[301],{"type":50,"value":302},"  now() - created AS total_duration,\n",{"type":45,"tag":223,"props":304,"children":306},{"class":225,"line":305},10,[307],{"type":45,"tag":223,"props":308,"children":309},{},[310],{"type":50,"value":311},"  error\n",{"type":45,"tag":223,"props":313,"children":315},{"class":225,"line":314},11,[316],{"type":45,"tag":223,"props":317,"children":318},{},[319],{"type":50,"value":320},"FROM j\n",{"type":45,"tag":223,"props":322,"children":324},{"class":225,"line":323},12,[325],{"type":45,"tag":223,"props":326,"children":327},{},[328],{"type":50,"value":329},"WHERE status = 'failed'\n",{"type":45,"tag":223,"props":331,"children":333},{"class":225,"line":332},13,[334],{"type":45,"tag":223,"props":335,"children":336},{},[337],{"type":50,"value":338},"  AND created > now() - INTERVAL '12 hours'\n",{"type":45,"tag":223,"props":340,"children":342},{"class":225,"line":341},14,[343],{"type":45,"tag":223,"props":344,"children":345},{},[346],{"type":50,"value":347},"ORDER BY created DESC\n",{"type":45,"tag":223,"props":349,"children":351},{"class":225,"line":350},15,[352],{"type":45,"tag":223,"props":353,"children":354},{},[355],{"type":50,"value":356},"LIMIT 50;\n",{"type":45,"tag":53,"props":358,"children":359},{},[360],{"type":45,"tag":109,"props":361,"children":362},{},[363],{"type":50,"value":364},"Key columns:",{"type":45,"tag":66,"props":366,"children":367},{},[368,379,390],{"type":45,"tag":70,"props":369,"children":370},{},[371,377],{"type":45,"tag":76,"props":372,"children":374},{"className":373},[],[375],{"type":50,"value":376},"error",{"type":50,"value":378},": Failure reason (check for permission errors, disk space, network issues)",{"type":45,"tag":70,"props":380,"children":381},{},[382,388],{"type":45,"tag":76,"props":383,"children":385},{"className":384},[],[386],{"type":50,"value":387},"description",{"type":50,"value":389},": Human-readable description of what the job was doing",{"type":45,"tag":70,"props":391,"children":392},{},[393,399],{"type":45,"tag":76,"props":394,"children":396},{"className":395},[],[397],{"type":50,"value":398},"total_duration",{"type":50,"value":400},": How long the job ran before failing",{"type":45,"tag":53,"props":402,"children":403},{},[404],{"type":45,"tag":109,"props":405,"children":406},{},[407],{"type":50,"value":408},"Common failure patterns:",{"type":45,"tag":66,"props":410,"children":411},{},[412,417,422,427],{"type":45,"tag":70,"props":413,"children":414},{},[415],{"type":50,"value":416},"Permission denied: User lacks required privileges",{"type":45,"tag":70,"props":418,"children":419},{},[420],{"type":50,"value":421},"Disk space: Backup destination full",{"type":45,"tag":70,"props":423,"children":424},{},[425],{"type":50,"value":426},"Network timeout: External storage unreachable",{"type":45,"tag":70,"props":428,"children":429},{},[430],{"type":50,"value":431},"Constraint violation: Restore conflicts with existing data",{"type":45,"tag":200,"props":433,"children":435},{"id":434},"query-2-long-running-jobs",[436],{"type":50,"value":437},"Query 2: Long-Running Jobs",{"type":45,"tag":53,"props":439,"children":440},{},[441],{"type":50,"value":442},"Find jobs running longer than expected threshold:",{"type":45,"tag":212,"props":444,"children":446},{"className":214,"code":445,"language":216,"meta":217,"style":217},"-- Jobs running longer than 1 hour\nWITH j AS (SHOW JOBS)\nSELECT\n  job_id,\n  job_type,\n  description,\n  status,\n  running_status,\n  created,\n  now() - created AS running_for,\n  fraction_completed,\n  coordinator_id\nFROM j\nWHERE status = 'running'\n  AND created \u003C now() - INTERVAL '1 hour'\nORDER BY created\nLIMIT 50;\n",[447],{"type":45,"tag":76,"props":448,"children":449},{"__ignoreMap":217},[450,458,465,472,479,486,493,501,509,516,524,532,540,547,555,563,572],{"type":45,"tag":223,"props":451,"children":452},{"class":225,"line":226},[453],{"type":45,"tag":223,"props":454,"children":455},{},[456],{"type":50,"value":457},"-- Jobs running longer than 1 hour\n",{"type":45,"tag":223,"props":459,"children":460},{"class":225,"line":26},[461],{"type":45,"tag":223,"props":462,"children":463},{},[464],{"type":50,"value":240},{"type":45,"tag":223,"props":466,"children":467},{"class":225,"line":22},[468],{"type":45,"tag":223,"props":469,"children":470},{},[471],{"type":50,"value":248},{"type":45,"tag":223,"props":473,"children":474},{"class":225,"line":251},[475],{"type":45,"tag":223,"props":476,"children":477},{},[478],{"type":50,"value":257},{"type":45,"tag":223,"props":480,"children":481},{"class":225,"line":260},[482],{"type":45,"tag":223,"props":483,"children":484},{},[485],{"type":50,"value":266},{"type":45,"tag":223,"props":487,"children":488},{"class":225,"line":269},[489],{"type":45,"tag":223,"props":490,"children":491},{},[492],{"type":50,"value":275},{"type":45,"tag":223,"props":494,"children":495},{"class":225,"line":278},[496],{"type":45,"tag":223,"props":497,"children":498},{},[499],{"type":50,"value":500},"  status,\n",{"type":45,"tag":223,"props":502,"children":503},{"class":225,"line":287},[504],{"type":45,"tag":223,"props":505,"children":506},{},[507],{"type":50,"value":508},"  running_status,\n",{"type":45,"tag":223,"props":510,"children":511},{"class":225,"line":296},[512],{"type":45,"tag":223,"props":513,"children":514},{},[515],{"type":50,"value":284},{"type":45,"tag":223,"props":517,"children":518},{"class":225,"line":305},[519],{"type":45,"tag":223,"props":520,"children":521},{},[522],{"type":50,"value":523},"  now() - created AS running_for,\n",{"type":45,"tag":223,"props":525,"children":526},{"class":225,"line":314},[527],{"type":45,"tag":223,"props":528,"children":529},{},[530],{"type":50,"value":531},"  fraction_completed,\n",{"type":45,"tag":223,"props":533,"children":534},{"class":225,"line":323},[535],{"type":45,"tag":223,"props":536,"children":537},{},[538],{"type":50,"value":539},"  coordinator_id\n",{"type":45,"tag":223,"props":541,"children":542},{"class":225,"line":332},[543],{"type":45,"tag":223,"props":544,"children":545},{},[546],{"type":50,"value":320},{"type":45,"tag":223,"props":548,"children":549},{"class":225,"line":341},[550],{"type":45,"tag":223,"props":551,"children":552},{},[553],{"type":50,"value":554},"WHERE status = 'running'\n",{"type":45,"tag":223,"props":556,"children":557},{"class":225,"line":350},[558],{"type":45,"tag":223,"props":559,"children":560},{},[561],{"type":50,"value":562},"  AND created \u003C now() - INTERVAL '1 hour'\n",{"type":45,"tag":223,"props":564,"children":566},{"class":225,"line":565},16,[567],{"type":45,"tag":223,"props":568,"children":569},{},[570],{"type":50,"value":571},"ORDER BY created\n",{"type":45,"tag":223,"props":573,"children":575},{"class":225,"line":574},17,[576],{"type":45,"tag":223,"props":577,"children":578},{},[579],{"type":50,"value":356},{"type":45,"tag":53,"props":581,"children":582},{},[583],{"type":45,"tag":109,"props":584,"children":585},{},[586],{"type":50,"value":364},{"type":45,"tag":66,"props":588,"children":589},{},[590,601,612],{"type":45,"tag":70,"props":591,"children":592},{},[593,599],{"type":45,"tag":76,"props":594,"children":596},{"className":595},[],[597],{"type":50,"value":598},"running_for",{"type":50,"value":600},": Total elapsed time since job started",{"type":45,"tag":70,"props":602,"children":603},{},[604,610],{"type":45,"tag":76,"props":605,"children":607},{"className":606},[],[608],{"type":50,"value":609},"fraction_completed",{"type":50,"value":611},": Progress estimate (0.0 to 1.0, NULL if unavailable)",{"type":45,"tag":70,"props":613,"children":614},{},[615,621],{"type":45,"tag":76,"props":616,"children":618},{"className":617},[],[619],{"type":50,"value":620},"running_status",{"type":50,"value":622},": Sub-state details (e.g., \"waiting for MVCC GC\")",{"type":45,"tag":53,"props":624,"children":625},{},[626],{"type":45,"tag":109,"props":627,"children":628},{},[629],{"type":50,"value":630},"Customizable thresholds:",{"type":45,"tag":66,"props":632,"children":633},{},[634,639,644],{"type":45,"tag":70,"props":635,"children":636},{},[637],{"type":50,"value":638},"Schema changes: 30 minutes to several hours (depends on table size)",{"type":45,"tag":70,"props":640,"children":641},{},[642],{"type":50,"value":643},"Backups: 1-6+ hours (depends on data volume)",{"type":45,"tag":70,"props":645,"children":646},{},[647],{"type":50,"value":648},"Automatic jobs: Usually \u003C 30 minutes",{"type":45,"tag":200,"props":650,"children":652},{"id":651},"query-3-paused-jobs",[653],{"type":50,"value":654},"Query 3: Paused Jobs",{"type":45,"tag":53,"props":656,"children":657},{},[658],{"type":50,"value":659},"Identify jobs that are paused and may need attention:",{"type":45,"tag":212,"props":661,"children":663},{"className":214,"code":662,"language":216,"meta":217,"style":217},"-- Paused jobs needing resume\nWITH j AS (SHOW JOBS)\nSELECT\n  job_id,\n  job_type,\n  description,\n  created,\n  now() - created AS paused_for,\n  coordinator_id\nFROM j\nWHERE status = 'paused'\nORDER BY created\nLIMIT 50;\n",[664],{"type":45,"tag":76,"props":665,"children":666},{"__ignoreMap":217},[667,675,682,689,696,703,710,717,725,732,739,747,754],{"type":45,"tag":223,"props":668,"children":669},{"class":225,"line":226},[670],{"type":45,"tag":223,"props":671,"children":672},{},[673],{"type":50,"value":674},"-- Paused jobs needing resume\n",{"type":45,"tag":223,"props":676,"children":677},{"class":225,"line":26},[678],{"type":45,"tag":223,"props":679,"children":680},{},[681],{"type":50,"value":240},{"type":45,"tag":223,"props":683,"children":684},{"class":225,"line":22},[685],{"type":45,"tag":223,"props":686,"children":687},{},[688],{"type":50,"value":248},{"type":45,"tag":223,"props":690,"children":691},{"class":225,"line":251},[692],{"type":45,"tag":223,"props":693,"children":694},{},[695],{"type":50,"value":257},{"type":45,"tag":223,"props":697,"children":698},{"class":225,"line":260},[699],{"type":45,"tag":223,"props":700,"children":701},{},[702],{"type":50,"value":266},{"type":45,"tag":223,"props":704,"children":705},{"class":225,"line":269},[706],{"type":45,"tag":223,"props":707,"children":708},{},[709],{"type":50,"value":275},{"type":45,"tag":223,"props":711,"children":712},{"class":225,"line":278},[713],{"type":45,"tag":223,"props":714,"children":715},{},[716],{"type":50,"value":284},{"type":45,"tag":223,"props":718,"children":719},{"class":225,"line":287},[720],{"type":45,"tag":223,"props":721,"children":722},{},[723],{"type":50,"value":724},"  now() - created AS paused_for,\n",{"type":45,"tag":223,"props":726,"children":727},{"class":225,"line":296},[728],{"type":45,"tag":223,"props":729,"children":730},{},[731],{"type":50,"value":539},{"type":45,"tag":223,"props":733,"children":734},{"class":225,"line":305},[735],{"type":45,"tag":223,"props":736,"children":737},{},[738],{"type":50,"value":320},{"type":45,"tag":223,"props":740,"children":741},{"class":225,"line":314},[742],{"type":45,"tag":223,"props":743,"children":744},{},[745],{"type":50,"value":746},"WHERE status = 'paused'\n",{"type":45,"tag":223,"props":748,"children":749},{"class":225,"line":323},[750],{"type":45,"tag":223,"props":751,"children":752},{},[753],{"type":50,"value":571},{"type":45,"tag":223,"props":755,"children":756},{"class":225,"line":332},[757],{"type":45,"tag":223,"props":758,"children":759},{},[760],{"type":50,"value":356},{"type":45,"tag":53,"props":762,"children":763},{},[764,769,771,777],{"type":45,"tag":109,"props":765,"children":766},{},[767],{"type":50,"value":768},"Action required:",{"type":50,"value":770},"\nResume with ",{"type":45,"tag":76,"props":772,"children":774},{"className":773},[],[775],{"type":50,"value":776},"RESUME JOB \u003Cjob_id>",{"type":50,"value":778}," after verifying the pause reason.",{"type":45,"tag":53,"props":780,"children":781},{},[782],{"type":45,"tag":109,"props":783,"children":784},{},[785],{"type":50,"value":786},"Common reasons for paused jobs:",{"type":45,"tag":66,"props":788,"children":789},{},[790,795,800],{"type":45,"tag":70,"props":791,"children":792},{},[793],{"type":50,"value":794},"Manual user pause for maintenance",{"type":45,"tag":70,"props":796,"children":797},{},[798],{"type":50,"value":799},"Resource constraints (cluster paused the job)",{"type":45,"tag":70,"props":801,"children":802},{},[803],{"type":50,"value":804},"Error requiring manual intervention",{"type":45,"tag":200,"props":806,"children":808},{"id":807},"query-4-schema-changes-waiting-for-mvcc-gc",[809],{"type":50,"value":810},"Query 4: Schema Changes Waiting for MVCC GC",{"type":45,"tag":53,"props":812,"children":813},{},[814],{"type":50,"value":815},"Find SCHEMA CHANGE GC jobs waiting for garbage collection:",{"type":45,"tag":212,"props":817,"children":819},{"className":214,"code":818,"language":216,"meta":217,"style":217},"-- Schema change cleanup jobs waiting for GC\nWITH j AS (SHOW JOBS)\nSELECT\n  job_id,\n  job_type,\n  description,\n  created,\n  now() - created AS waiting_for,\n  running_status\nFROM j\nWHERE status = 'running'\n  AND job_type = 'SCHEMA CHANGE GC'\n  AND running_status LIKE '%waiting for MVCC GC%'\nORDER BY created\nLIMIT 50;\n",[820],{"type":45,"tag":76,"props":821,"children":822},{"__ignoreMap":217},[823,831,838,845,852,859,866,873,881,889,896,903,911,919,926],{"type":45,"tag":223,"props":824,"children":825},{"class":225,"line":226},[826],{"type":45,"tag":223,"props":827,"children":828},{},[829],{"type":50,"value":830},"-- Schema change cleanup jobs waiting for GC\n",{"type":45,"tag":223,"props":832,"children":833},{"class":225,"line":26},[834],{"type":45,"tag":223,"props":835,"children":836},{},[837],{"type":50,"value":240},{"type":45,"tag":223,"props":839,"children":840},{"class":225,"line":22},[841],{"type":45,"tag":223,"props":842,"children":843},{},[844],{"type":50,"value":248},{"type":45,"tag":223,"props":846,"children":847},{"class":225,"line":251},[848],{"type":45,"tag":223,"props":849,"children":850},{},[851],{"type":50,"value":257},{"type":45,"tag":223,"props":853,"children":854},{"class":225,"line":260},[855],{"type":45,"tag":223,"props":856,"children":857},{},[858],{"type":50,"value":266},{"type":45,"tag":223,"props":860,"children":861},{"class":225,"line":269},[862],{"type":45,"tag":223,"props":863,"children":864},{},[865],{"type":50,"value":275},{"type":45,"tag":223,"props":867,"children":868},{"class":225,"line":278},[869],{"type":45,"tag":223,"props":870,"children":871},{},[872],{"type":50,"value":284},{"type":45,"tag":223,"props":874,"children":875},{"class":225,"line":287},[876],{"type":45,"tag":223,"props":877,"children":878},{},[879],{"type":50,"value":880},"  now() - created AS waiting_for,\n",{"type":45,"tag":223,"props":882,"children":883},{"class":225,"line":296},[884],{"type":45,"tag":223,"props":885,"children":886},{},[887],{"type":50,"value":888},"  running_status\n",{"type":45,"tag":223,"props":890,"children":891},{"class":225,"line":305},[892],{"type":45,"tag":223,"props":893,"children":894},{},[895],{"type":50,"value":320},{"type":45,"tag":223,"props":897,"children":898},{"class":225,"line":314},[899],{"type":45,"tag":223,"props":900,"children":901},{},[902],{"type":50,"value":554},{"type":45,"tag":223,"props":904,"children":905},{"class":225,"line":323},[906],{"type":45,"tag":223,"props":907,"children":908},{},[909],{"type":50,"value":910},"  AND job_type = 'SCHEMA CHANGE GC'\n",{"type":45,"tag":223,"props":912,"children":913},{"class":225,"line":332},[914],{"type":45,"tag":223,"props":915,"children":916},{},[917],{"type":50,"value":918},"  AND running_status LIKE '%waiting for MVCC GC%'\n",{"type":45,"tag":223,"props":920,"children":921},{"class":225,"line":341},[922],{"type":45,"tag":223,"props":923,"children":924},{},[925],{"type":50,"value":571},{"type":45,"tag":223,"props":927,"children":928},{"class":225,"line":350},[929],{"type":45,"tag":223,"props":930,"children":931},{},[932],{"type":50,"value":356},{"type":45,"tag":53,"props":934,"children":935},{},[936],{"type":45,"tag":109,"props":937,"children":938},{},[939],{"type":50,"value":940},"Interpretation:",{"type":45,"tag":66,"props":942,"children":943},{},[944,962,979],{"type":45,"tag":70,"props":945,"children":946},{},[947,952,954,960],{"type":45,"tag":109,"props":948,"children":949},{},[950],{"type":50,"value":951},"Normal:",{"type":50,"value":953}," SCHEMA CHANGE GC jobs wait for data to become garbage-collectable based on the zone-level ",{"type":45,"tag":76,"props":955,"children":957},{"className":956},[],[958],{"type":50,"value":959},"gc.ttlseconds",{"type":50,"value":961}," (default 4 hours)",{"type":45,"tag":70,"props":963,"children":964},{},[965,970,972,977],{"type":45,"tag":109,"props":966,"children":967},{},[968],{"type":50,"value":969},"Expected duration:",{"type":50,"value":971}," Up to ",{"type":45,"tag":76,"props":973,"children":975},{"className":974},[],[976],{"type":50,"value":959},{"type":50,"value":978}," + some overhead",{"type":45,"tag":70,"props":980,"children":981},{},[982,987,989,994,996,1002],{"type":45,"tag":109,"props":983,"children":984},{},[985],{"type":50,"value":986},"When to worry:",{"type":50,"value":988}," Waiting > 2x ",{"type":45,"tag":76,"props":990,"children":992},{"className":991},[],[993],{"type":50,"value":959},{"type":50,"value":995}," (check the effective value with ",{"type":45,"tag":76,"props":997,"children":999},{"className":998},[],[1000],{"type":50,"value":1001},"SHOW ZONE CONFIGURATION FOR ...",{"type":50,"value":1003}," against the affected table, database, or RANGE — zone configs cascade and may be overridden at any level)",{"type":45,"tag":53,"props":1005,"children":1006},{},[1007,1012],{"type":45,"tag":109,"props":1008,"children":1009},{},[1010],{"type":50,"value":1011},"Why this happens:",{"type":50,"value":1013},"\nAfter DROP TABLE\u002FINDEX operations, CockroachDB must wait for all reads at older timestamps to complete before physically removing data. This prevents \"time-travel\" queries from failing.",{"type":45,"tag":53,"props":1015,"children":1016},{},[1017,1018,1022],{"type":50,"value":176},{"type":45,"tag":117,"props":1019,"children":1020},{"href":187},[1021],{"type":50,"value":190},{"type":50,"value":1023}," for detailed MVCC GC explanation.",{"type":45,"tag":200,"props":1025,"children":1027},{"id":1026},"query-5-automatic-job-health-24h-window",[1028],{"type":50,"value":1029},"Query 5: Automatic Job Health (24h Window)",{"type":45,"tag":53,"props":1031,"children":1032},{},[1033],{"type":50,"value":1034},"Monitor automatic background jobs like statistics collection:",{"type":45,"tag":212,"props":1036,"children":1038},{"className":214,"code":1037,"language":216,"meta":217,"style":217},"-- Automatic jobs in last 24 hours\nSELECT\n  job_id,\n  job_type,\n  description,\n  status,\n  created,\n  finished,\n  COALESCE(finished, now()) - created AS duration\nFROM [SHOW AUTOMATIC JOBS]\nWHERE created > now() - INTERVAL '24 hours'\n  AND job_type IN ('AUTO CREATE STATS', 'AUTO SQL STATS COMPACTION')\nORDER BY created DESC\nLIMIT 50;\n",[1039],{"type":45,"tag":76,"props":1040,"children":1041},{"__ignoreMap":217},[1042,1050,1057,1064,1071,1078,1085,1092,1099,1107,1115,1123,1131,1138],{"type":45,"tag":223,"props":1043,"children":1044},{"class":225,"line":226},[1045],{"type":45,"tag":223,"props":1046,"children":1047},{},[1048],{"type":50,"value":1049},"-- Automatic jobs in last 24 hours\n",{"type":45,"tag":223,"props":1051,"children":1052},{"class":225,"line":26},[1053],{"type":45,"tag":223,"props":1054,"children":1055},{},[1056],{"type":50,"value":248},{"type":45,"tag":223,"props":1058,"children":1059},{"class":225,"line":22},[1060],{"type":45,"tag":223,"props":1061,"children":1062},{},[1063],{"type":50,"value":257},{"type":45,"tag":223,"props":1065,"children":1066},{"class":225,"line":251},[1067],{"type":45,"tag":223,"props":1068,"children":1069},{},[1070],{"type":50,"value":266},{"type":45,"tag":223,"props":1072,"children":1073},{"class":225,"line":260},[1074],{"type":45,"tag":223,"props":1075,"children":1076},{},[1077],{"type":50,"value":275},{"type":45,"tag":223,"props":1079,"children":1080},{"class":225,"line":269},[1081],{"type":45,"tag":223,"props":1082,"children":1083},{},[1084],{"type":50,"value":500},{"type":45,"tag":223,"props":1086,"children":1087},{"class":225,"line":278},[1088],{"type":45,"tag":223,"props":1089,"children":1090},{},[1091],{"type":50,"value":284},{"type":45,"tag":223,"props":1093,"children":1094},{"class":225,"line":287},[1095],{"type":45,"tag":223,"props":1096,"children":1097},{},[1098],{"type":50,"value":293},{"type":45,"tag":223,"props":1100,"children":1101},{"class":225,"line":296},[1102],{"type":45,"tag":223,"props":1103,"children":1104},{},[1105],{"type":50,"value":1106},"  COALESCE(finished, now()) - created AS duration\n",{"type":45,"tag":223,"props":1108,"children":1109},{"class":225,"line":305},[1110],{"type":45,"tag":223,"props":1111,"children":1112},{},[1113],{"type":50,"value":1114},"FROM [SHOW AUTOMATIC JOBS]\n",{"type":45,"tag":223,"props":1116,"children":1117},{"class":225,"line":314},[1118],{"type":45,"tag":223,"props":1119,"children":1120},{},[1121],{"type":50,"value":1122},"WHERE created > now() - INTERVAL '24 hours'\n",{"type":45,"tag":223,"props":1124,"children":1125},{"class":225,"line":323},[1126],{"type":45,"tag":223,"props":1127,"children":1128},{},[1129],{"type":50,"value":1130},"  AND job_type IN ('AUTO CREATE STATS', 'AUTO SQL STATS COMPACTION')\n",{"type":45,"tag":223,"props":1132,"children":1133},{"class":225,"line":332},[1134],{"type":45,"tag":223,"props":1135,"children":1136},{},[1137],{"type":50,"value":347},{"type":45,"tag":223,"props":1139,"children":1140},{"class":225,"line":341},[1141],{"type":45,"tag":223,"props":1142,"children":1143},{},[1144],{"type":50,"value":356},{"type":45,"tag":53,"props":1146,"children":1147},{},[1148],{"type":45,"tag":109,"props":1149,"children":1150},{},[1151],{"type":50,"value":1152},"Key job types:",{"type":45,"tag":66,"props":1154,"children":1155},{},[1156,1167],{"type":45,"tag":70,"props":1157,"children":1158},{},[1159,1165],{"type":45,"tag":76,"props":1160,"children":1162},{"className":1161},[],[1163],{"type":50,"value":1164},"AUTO CREATE STATS",{"type":50,"value":1166},": Automatic table statistics refresh (critical for query optimizer)",{"type":45,"tag":70,"props":1168,"children":1169},{},[1170,1176],{"type":45,"tag":76,"props":1171,"children":1173},{"className":1172},[],[1174],{"type":50,"value":1175},"AUTO SQL STATS COMPACTION",{"type":50,"value":1177},": Periodic cleanup of statement\u002Ftransaction statistics tables",{"type":45,"tag":53,"props":1179,"children":1180},{},[1181],{"type":45,"tag":109,"props":1182,"children":1183},{},[1184],{"type":50,"value":1185},"Health indicators:",{"type":45,"tag":66,"props":1187,"children":1188},{},[1189,1199,1209],{"type":45,"tag":70,"props":1190,"children":1191},{},[1192,1197],{"type":45,"tag":109,"props":1193,"children":1194},{},[1195],{"type":50,"value":1196},"Healthy:",{"type":50,"value":1198}," Regular successful executions (every few hours)",{"type":45,"tag":70,"props":1200,"children":1201},{},[1202,1207],{"type":45,"tag":109,"props":1203,"children":1204},{},[1205],{"type":50,"value":1206},"Unhealthy:",{"type":50,"value":1208}," No recent executions, or high failure rate",{"type":45,"tag":70,"props":1210,"children":1211},{},[1212,1217],{"type":45,"tag":109,"props":1213,"children":1214},{},[1215],{"type":50,"value":1216},"Impact of failure:",{"type":50,"value":1218}," Stale statistics lead to poor query plans and slow queries",{"type":45,"tag":200,"props":1220,"children":1222},{"id":1221},"query-6-jobs-by-type-and-status",[1223],{"type":50,"value":1224},"Query 6: Jobs by Type and Status",{"type":45,"tag":53,"props":1226,"children":1227},{},[1228],{"type":50,"value":1229},"Aggregated view for pattern analysis:",{"type":45,"tag":212,"props":1231,"children":1233},{"className":214,"code":1232,"language":216,"meta":217,"style":217},"-- Job distribution by type and status (last 24h)\nWITH j AS (SHOW JOBS)\nSELECT\n  job_type,\n  status,\n  COUNT(*) AS job_count,\n  MIN(created) AS oldest,\n  MAX(created) AS newest\nFROM j\nWHERE created > now() - INTERVAL '24 hours'\nGROUP BY job_type, status\nORDER BY job_type, status;\n",[1234],{"type":45,"tag":76,"props":1235,"children":1236},{"__ignoreMap":217},[1237,1245,1252,1259,1266,1273,1281,1289,1297,1304,1311,1319],{"type":45,"tag":223,"props":1238,"children":1239},{"class":225,"line":226},[1240],{"type":45,"tag":223,"props":1241,"children":1242},{},[1243],{"type":50,"value":1244},"-- Job distribution by type and status (last 24h)\n",{"type":45,"tag":223,"props":1246,"children":1247},{"class":225,"line":26},[1248],{"type":45,"tag":223,"props":1249,"children":1250},{},[1251],{"type":50,"value":240},{"type":45,"tag":223,"props":1253,"children":1254},{"class":225,"line":22},[1255],{"type":45,"tag":223,"props":1256,"children":1257},{},[1258],{"type":50,"value":248},{"type":45,"tag":223,"props":1260,"children":1261},{"class":225,"line":251},[1262],{"type":45,"tag":223,"props":1263,"children":1264},{},[1265],{"type":50,"value":266},{"type":45,"tag":223,"props":1267,"children":1268},{"class":225,"line":260},[1269],{"type":45,"tag":223,"props":1270,"children":1271},{},[1272],{"type":50,"value":500},{"type":45,"tag":223,"props":1274,"children":1275},{"class":225,"line":269},[1276],{"type":45,"tag":223,"props":1277,"children":1278},{},[1279],{"type":50,"value":1280},"  COUNT(*) AS job_count,\n",{"type":45,"tag":223,"props":1282,"children":1283},{"class":225,"line":278},[1284],{"type":45,"tag":223,"props":1285,"children":1286},{},[1287],{"type":50,"value":1288},"  MIN(created) AS oldest,\n",{"type":45,"tag":223,"props":1290,"children":1291},{"class":225,"line":287},[1292],{"type":45,"tag":223,"props":1293,"children":1294},{},[1295],{"type":50,"value":1296},"  MAX(created) AS newest\n",{"type":45,"tag":223,"props":1298,"children":1299},{"class":225,"line":296},[1300],{"type":45,"tag":223,"props":1301,"children":1302},{},[1303],{"type":50,"value":320},{"type":45,"tag":223,"props":1305,"children":1306},{"class":225,"line":305},[1307],{"type":45,"tag":223,"props":1308,"children":1309},{},[1310],{"type":50,"value":1122},{"type":45,"tag":223,"props":1312,"children":1313},{"class":225,"line":314},[1314],{"type":45,"tag":223,"props":1315,"children":1316},{},[1317],{"type":50,"value":1318},"GROUP BY job_type, status\n",{"type":45,"tag":223,"props":1320,"children":1321},{"class":225,"line":323},[1322],{"type":45,"tag":223,"props":1323,"children":1324},{},[1325],{"type":50,"value":1326},"ORDER BY job_type, status;\n",{"type":45,"tag":53,"props":1328,"children":1329},{},[1330],{"type":45,"tag":109,"props":1331,"children":1332},{},[1333],{"type":50,"value":1334},"Use case:",{"type":45,"tag":66,"props":1336,"children":1337},{},[1338,1343,1348],{"type":45,"tag":70,"props":1339,"children":1340},{},[1341],{"type":50,"value":1342},"Identify patterns (e.g., all BACKUP jobs failing, multiple schema changes stuck)",{"type":45,"tag":70,"props":1344,"children":1345},{},[1346],{"type":50,"value":1347},"Spot anomalies (e.g., unusual job type volume)",{"type":45,"tag":70,"props":1349,"children":1350},{},[1351],{"type":50,"value":1352},"Track job success rates by type",{"type":45,"tag":200,"props":1354,"children":1356},{"id":1355},"query-7-backup-and-restore-progress",[1357],{"type":50,"value":1358},"Query 7: Backup and Restore Progress",{"type":45,"tag":53,"props":1360,"children":1361},{},[1362],{"type":50,"value":1363},"Track progress of backup\u002Frestore jobs:",{"type":45,"tag":212,"props":1365,"children":1367},{"className":214,"code":1366,"language":216,"meta":217,"style":217},"-- Active backup\u002Frestore jobs with progress\nWITH j AS (SHOW JOBS)\nSELECT\n  job_id,\n  job_type,\n  description,\n  created,\n  now() - created AS running_for,\n  ROUND(COALESCE(fraction_completed, 0) * 100, 2) AS percent_complete,\n  CASE\n    WHEN fraction_completed > 0 AND fraction_completed \u003C 1 THEN\n      ((now() - created) \u002F fraction_completed) - (now() - created)\n    ELSE NULL\n  END AS estimated_time_remaining,\n  running_status\nFROM j\nWHERE status = 'running'\n  AND job_type IN ('BACKUP', 'RESTORE')\nORDER BY created\nLIMIT 50;\n",[1368],{"type":45,"tag":76,"props":1369,"children":1370},{"__ignoreMap":217},[1371,1379,1386,1393,1400,1407,1414,1421,1428,1436,1444,1452,1460,1468,1476,1483,1490,1497,1506,1514],{"type":45,"tag":223,"props":1372,"children":1373},{"class":225,"line":226},[1374],{"type":45,"tag":223,"props":1375,"children":1376},{},[1377],{"type":50,"value":1378},"-- Active backup\u002Frestore jobs with progress\n",{"type":45,"tag":223,"props":1380,"children":1381},{"class":225,"line":26},[1382],{"type":45,"tag":223,"props":1383,"children":1384},{},[1385],{"type":50,"value":240},{"type":45,"tag":223,"props":1387,"children":1388},{"class":225,"line":22},[1389],{"type":45,"tag":223,"props":1390,"children":1391},{},[1392],{"type":50,"value":248},{"type":45,"tag":223,"props":1394,"children":1395},{"class":225,"line":251},[1396],{"type":45,"tag":223,"props":1397,"children":1398},{},[1399],{"type":50,"value":257},{"type":45,"tag":223,"props":1401,"children":1402},{"class":225,"line":260},[1403],{"type":45,"tag":223,"props":1404,"children":1405},{},[1406],{"type":50,"value":266},{"type":45,"tag":223,"props":1408,"children":1409},{"class":225,"line":269},[1410],{"type":45,"tag":223,"props":1411,"children":1412},{},[1413],{"type":50,"value":275},{"type":45,"tag":223,"props":1415,"children":1416},{"class":225,"line":278},[1417],{"type":45,"tag":223,"props":1418,"children":1419},{},[1420],{"type":50,"value":284},{"type":45,"tag":223,"props":1422,"children":1423},{"class":225,"line":287},[1424],{"type":45,"tag":223,"props":1425,"children":1426},{},[1427],{"type":50,"value":523},{"type":45,"tag":223,"props":1429,"children":1430},{"class":225,"line":296},[1431],{"type":45,"tag":223,"props":1432,"children":1433},{},[1434],{"type":50,"value":1435},"  ROUND(COALESCE(fraction_completed, 0) * 100, 2) AS percent_complete,\n",{"type":45,"tag":223,"props":1437,"children":1438},{"class":225,"line":305},[1439],{"type":45,"tag":223,"props":1440,"children":1441},{},[1442],{"type":50,"value":1443},"  CASE\n",{"type":45,"tag":223,"props":1445,"children":1446},{"class":225,"line":314},[1447],{"type":45,"tag":223,"props":1448,"children":1449},{},[1450],{"type":50,"value":1451},"    WHEN fraction_completed > 0 AND fraction_completed \u003C 1 THEN\n",{"type":45,"tag":223,"props":1453,"children":1454},{"class":225,"line":323},[1455],{"type":45,"tag":223,"props":1456,"children":1457},{},[1458],{"type":50,"value":1459},"      ((now() - created) \u002F fraction_completed) - (now() - created)\n",{"type":45,"tag":223,"props":1461,"children":1462},{"class":225,"line":332},[1463],{"type":45,"tag":223,"props":1464,"children":1465},{},[1466],{"type":50,"value":1467},"    ELSE NULL\n",{"type":45,"tag":223,"props":1469,"children":1470},{"class":225,"line":341},[1471],{"type":45,"tag":223,"props":1472,"children":1473},{},[1474],{"type":50,"value":1475},"  END AS estimated_time_remaining,\n",{"type":45,"tag":223,"props":1477,"children":1478},{"class":225,"line":350},[1479],{"type":45,"tag":223,"props":1480,"children":1481},{},[1482],{"type":50,"value":888},{"type":45,"tag":223,"props":1484,"children":1485},{"class":225,"line":565},[1486],{"type":45,"tag":223,"props":1487,"children":1488},{},[1489],{"type":50,"value":320},{"type":45,"tag":223,"props":1491,"children":1492},{"class":225,"line":574},[1493],{"type":45,"tag":223,"props":1494,"children":1495},{},[1496],{"type":50,"value":554},{"type":45,"tag":223,"props":1498,"children":1500},{"class":225,"line":1499},18,[1501],{"type":45,"tag":223,"props":1502,"children":1503},{},[1504],{"type":50,"value":1505},"  AND job_type IN ('BACKUP', 'RESTORE')\n",{"type":45,"tag":223,"props":1507,"children":1509},{"class":225,"line":1508},19,[1510],{"type":45,"tag":223,"props":1511,"children":1512},{},[1513],{"type":50,"value":571},{"type":45,"tag":223,"props":1515,"children":1517},{"class":225,"line":1516},20,[1518],{"type":45,"tag":223,"props":1519,"children":1520},{},[1521],{"type":50,"value":356},{"type":45,"tag":53,"props":1523,"children":1524},{},[1525],{"type":45,"tag":109,"props":1526,"children":1527},{},[1528],{"type":50,"value":364},{"type":45,"tag":66,"props":1530,"children":1531},{},[1532,1543,1554],{"type":45,"tag":70,"props":1533,"children":1534},{},[1535,1541],{"type":45,"tag":76,"props":1536,"children":1538},{"className":1537},[],[1539],{"type":50,"value":1540},"percent_complete",{"type":50,"value":1542},": Progress percentage (0-100)",{"type":45,"tag":70,"props":1544,"children":1545},{},[1546,1552],{"type":45,"tag":76,"props":1547,"children":1549},{"className":1548},[],[1550],{"type":50,"value":1551},"estimated_time_remaining",{"type":50,"value":1553},": Rough estimate based on current progress rate",{"type":45,"tag":70,"props":1555,"children":1556},{},[1557,1562],{"type":45,"tag":76,"props":1558,"children":1560},{"className":1559},[],[1561],{"type":50,"value":620},{"type":50,"value":1563},": Detailed status (e.g., \"performing backup to s3:\u002F\u002F...\")",{"type":45,"tag":53,"props":1565,"children":1566},{},[1567,1572,1573,1578],{"type":45,"tag":109,"props":1568,"children":1569},{},[1570],{"type":50,"value":1571},"Note:",{"type":50,"value":115},{"type":45,"tag":76,"props":1574,"children":1576},{"className":1575},[],[1577],{"type":50,"value":609},{"type":50,"value":1579}," may be NULL for some job types or early in execution.",{"type":45,"tag":59,"props":1581,"children":1583},{"id":1582},"common-workflows",[1584],{"type":50,"value":1585},"Common Workflows",{"type":45,"tag":200,"props":1587,"children":1589},{"id":1588},"workflow-1-schema-change-stuck-investigation",[1590],{"type":50,"value":1591},"Workflow 1: Schema Change Stuck Investigation",{"type":45,"tag":53,"props":1593,"children":1594},{},[1595,1600],{"type":45,"tag":109,"props":1596,"children":1597},{},[1598],{"type":50,"value":1599},"Scenario:",{"type":50,"value":1601}," User reports ALTER TABLE or CREATE INDEX appears stuck.",{"type":45,"tag":1603,"props":1604,"children":1605},"ol",{},[1606,1674,1696,1750],{"type":45,"tag":70,"props":1607,"children":1608},{},[1609,1614],{"type":45,"tag":109,"props":1610,"children":1611},{},[1612],{"type":50,"value":1613},"Check for running schema changes:",{"type":45,"tag":212,"props":1615,"children":1617},{"className":214,"code":1616,"language":216,"meta":217,"style":217},"WITH j AS (SHOW JOBS)\nSELECT job_id, description, created, now() - created AS running_for,\n       fraction_completed, running_status\nFROM j\nWHERE status = 'running'\n  AND job_type IN ('SCHEMA CHANGE', 'NEW SCHEMA CHANGE')\nORDER BY created;\n",[1618],{"type":45,"tag":76,"props":1619,"children":1620},{"__ignoreMap":217},[1621,1628,1636,1644,1651,1658,1666],{"type":45,"tag":223,"props":1622,"children":1623},{"class":225,"line":226},[1624],{"type":45,"tag":223,"props":1625,"children":1626},{},[1627],{"type":50,"value":240},{"type":45,"tag":223,"props":1629,"children":1630},{"class":225,"line":26},[1631],{"type":45,"tag":223,"props":1632,"children":1633},{},[1634],{"type":50,"value":1635},"SELECT job_id, description, created, now() - created AS running_for,\n",{"type":45,"tag":223,"props":1637,"children":1638},{"class":225,"line":22},[1639],{"type":45,"tag":223,"props":1640,"children":1641},{},[1642],{"type":50,"value":1643},"       fraction_completed, running_status\n",{"type":45,"tag":223,"props":1645,"children":1646},{"class":225,"line":251},[1647],{"type":45,"tag":223,"props":1648,"children":1649},{},[1650],{"type":50,"value":320},{"type":45,"tag":223,"props":1652,"children":1653},{"class":225,"line":260},[1654],{"type":45,"tag":223,"props":1655,"children":1656},{},[1657],{"type":50,"value":554},{"type":45,"tag":223,"props":1659,"children":1660},{"class":225,"line":269},[1661],{"type":45,"tag":223,"props":1662,"children":1663},{},[1664],{"type":50,"value":1665},"  AND job_type IN ('SCHEMA CHANGE', 'NEW SCHEMA CHANGE')\n",{"type":45,"tag":223,"props":1667,"children":1668},{"class":225,"line":278},[1669],{"type":45,"tag":223,"props":1670,"children":1671},{},[1672],{"type":50,"value":1673},"ORDER BY created;\n",{"type":45,"tag":70,"props":1675,"children":1676},{},[1677,1682],{"type":45,"tag":109,"props":1678,"children":1679},{},[1680],{"type":50,"value":1681},"Identify MVCC GC waits:",{"type":45,"tag":212,"props":1683,"children":1685},{"className":214,"code":1684,"language":216,"meta":217,"style":217},"-- Use Query 4 to find \"waiting for MVCC GC\" jobs\n",[1686],{"type":45,"tag":76,"props":1687,"children":1688},{"__ignoreMap":217},[1689],{"type":45,"tag":223,"props":1690,"children":1691},{"class":225,"line":226},[1692],{"type":45,"tag":223,"props":1693,"children":1694},{},[1695],{"type":50,"value":1684},{"type":45,"tag":70,"props":1697,"children":1698},{},[1699,1704],{"type":45,"tag":109,"props":1700,"children":1701},{},[1702],{"type":50,"value":1703},"Interpret results:",{"type":45,"tag":66,"props":1705,"children":1706},{},[1707,1726,1738],{"type":45,"tag":70,"props":1708,"children":1709},{},[1710,1712,1717,1719,1724],{"type":50,"value":1711},"If ",{"type":45,"tag":76,"props":1713,"children":1715},{"className":1714},[],[1716],{"type":50,"value":620},{"type":50,"value":1718}," = \"waiting for MVCC GC\": Normal for post-DROP cleanup (wait up to ",{"type":45,"tag":76,"props":1720,"children":1722},{"className":1721},[],[1723],{"type":50,"value":959},{"type":50,"value":1725},")",{"type":45,"tag":70,"props":1727,"children":1728},{},[1729,1731,1736],{"type":50,"value":1730},"If long-running with low ",{"type":45,"tag":76,"props":1732,"children":1734},{"className":1733},[],[1735],{"type":50,"value":609},{"type":50,"value":1737},": Check for contention, large table size, or resource constraints",{"type":45,"tag":70,"props":1739,"children":1740},{},[1741,1743,1748],{"type":50,"value":1742},"If failed: Check ",{"type":45,"tag":76,"props":1744,"children":1746},{"className":1745},[],[1747],{"type":50,"value":376},{"type":50,"value":1749}," column for specific failure reason",{"type":45,"tag":70,"props":1751,"children":1752},{},[1753,1758],{"type":45,"tag":109,"props":1754,"children":1755},{},[1756],{"type":50,"value":1757},"Next steps:",{"type":45,"tag":66,"props":1759,"children":1760},{},[1761,1781,1786],{"type":45,"tag":70,"props":1762,"children":1763},{},[1764,1766,1771,1773,1779],{"type":50,"value":1765},"MVCC GC wait: Verify the effective ",{"type":45,"tag":76,"props":1767,"children":1769},{"className":1768},[],[1770],{"type":50,"value":959},{"type":50,"value":1772}," with ",{"type":45,"tag":76,"props":1774,"children":1776},{"className":1775},[],[1777],{"type":50,"value":1778},"SHOW ZONE CONFIGURATION FOR TABLE\u002FDATABASE\u002FRANGE ...",{"type":50,"value":1780}," against the affected object and wait",{"type":45,"tag":70,"props":1782,"children":1783},{},[1784],{"type":50,"value":1785},"Resource constraints: Check cluster CPU\u002Fmemory usage",{"type":45,"tag":70,"props":1787,"children":1788},{},[1789],{"type":50,"value":1790},"Failed job: Address error (permissions, constraints) and retry operation",{"type":45,"tag":200,"props":1792,"children":1794},{"id":1793},"workflow-2-failed-backup-triage",[1795],{"type":50,"value":1796},"Workflow 2: Failed Backup Triage",{"type":45,"tag":53,"props":1798,"children":1799},{},[1800,1804],{"type":45,"tag":109,"props":1801,"children":1802},{},[1803],{"type":50,"value":1599},{"type":50,"value":1805}," Scheduled backup job failed.",{"type":45,"tag":1603,"props":1807,"children":1808},{},[1809,1885,1916,1947],{"type":45,"tag":70,"props":1810,"children":1811},{},[1812,1817],{"type":45,"tag":109,"props":1813,"children":1814},{},[1815],{"type":50,"value":1816},"Find recent failed backups:",{"type":45,"tag":212,"props":1818,"children":1820},{"className":214,"code":1819,"language":216,"meta":217,"style":217},"-- Use Query 1 filtered for BACKUP job type\nWITH j AS (SHOW JOBS)\nSELECT job_id, description, created, finished, error\nFROM j\nWHERE status = 'failed'\n  AND job_type = 'BACKUP'\n  AND created > now() - INTERVAL '24 hours'\nORDER BY created DESC;\n",[1821],{"type":45,"tag":76,"props":1822,"children":1823},{"__ignoreMap":217},[1824,1832,1839,1847,1854,1861,1869,1877],{"type":45,"tag":223,"props":1825,"children":1826},{"class":225,"line":226},[1827],{"type":45,"tag":223,"props":1828,"children":1829},{},[1830],{"type":50,"value":1831},"-- Use Query 1 filtered for BACKUP job type\n",{"type":45,"tag":223,"props":1833,"children":1834},{"class":225,"line":26},[1835],{"type":45,"tag":223,"props":1836,"children":1837},{},[1838],{"type":50,"value":240},{"type":45,"tag":223,"props":1840,"children":1841},{"class":225,"line":22},[1842],{"type":45,"tag":223,"props":1843,"children":1844},{},[1845],{"type":50,"value":1846},"SELECT job_id, description, created, finished, error\n",{"type":45,"tag":223,"props":1848,"children":1849},{"class":225,"line":251},[1850],{"type":45,"tag":223,"props":1851,"children":1852},{},[1853],{"type":50,"value":320},{"type":45,"tag":223,"props":1855,"children":1856},{"class":225,"line":260},[1857],{"type":45,"tag":223,"props":1858,"children":1859},{},[1860],{"type":50,"value":329},{"type":45,"tag":223,"props":1862,"children":1863},{"class":225,"line":269},[1864],{"type":45,"tag":223,"props":1865,"children":1866},{},[1867],{"type":50,"value":1868},"  AND job_type = 'BACKUP'\n",{"type":45,"tag":223,"props":1870,"children":1871},{"class":225,"line":278},[1872],{"type":45,"tag":223,"props":1873,"children":1874},{},[1875],{"type":50,"value":1876},"  AND created > now() - INTERVAL '24 hours'\n",{"type":45,"tag":223,"props":1878,"children":1879},{"class":225,"line":287},[1880],{"type":45,"tag":223,"props":1881,"children":1882},{},[1883],{"type":50,"value":1884},"ORDER BY created DESC;\n",{"type":45,"tag":70,"props":1886,"children":1887},{},[1888,1893],{"type":45,"tag":109,"props":1889,"children":1890},{},[1891],{"type":50,"value":1892},"Analyze error messages:",{"type":45,"tag":66,"props":1894,"children":1895},{},[1896,1901,1906,1911],{"type":45,"tag":70,"props":1897,"children":1898},{},[1899],{"type":50,"value":1900},"\"permission denied\": Check external storage credentials",{"type":45,"tag":70,"props":1902,"children":1903},{},[1904],{"type":50,"value":1905},"\"timeout\": Network connectivity to backup destination",{"type":45,"tag":70,"props":1907,"children":1908},{},[1909],{"type":50,"value":1910},"\"no space left\": Destination storage full",{"type":45,"tag":70,"props":1912,"children":1913},{},[1914],{"type":50,"value":1915},"\"connection refused\": External storage endpoint unreachable",{"type":45,"tag":70,"props":1917,"children":1918},{},[1919,1924],{"type":45,"tag":109,"props":1920,"children":1921},{},[1922],{"type":50,"value":1923},"Verify backup destination:",{"type":45,"tag":212,"props":1925,"children":1927},{"className":214,"code":1926,"language":216,"meta":217,"style":217},"-- Check SHOW BACKUP for successful backups to same destination\nSHOW BACKUP 's3:\u002F\u002Fbucket\u002Fpath';\n",[1928],{"type":45,"tag":76,"props":1929,"children":1930},{"__ignoreMap":217},[1931,1939],{"type":45,"tag":223,"props":1932,"children":1933},{"class":225,"line":226},[1934],{"type":45,"tag":223,"props":1935,"children":1936},{},[1937],{"type":50,"value":1938},"-- Check SHOW BACKUP for successful backups to same destination\n",{"type":45,"tag":223,"props":1940,"children":1941},{"class":225,"line":26},[1942],{"type":45,"tag":223,"props":1943,"children":1944},{},[1945],{"type":50,"value":1946},"SHOW BACKUP 's3:\u002F\u002Fbucket\u002Fpath';\n",{"type":45,"tag":70,"props":1948,"children":1949},{},[1950,1955],{"type":45,"tag":109,"props":1951,"children":1952},{},[1953],{"type":50,"value":1954},"Remediate and retry:",{"type":45,"tag":66,"props":1956,"children":1957},{},[1958,1963,1968],{"type":45,"tag":70,"props":1959,"children":1960},{},[1961],{"type":50,"value":1962},"Fix underlying issue (credentials, storage, network)",{"type":45,"tag":70,"props":1964,"children":1965},{},[1966],{"type":50,"value":1967},"Re-run backup command",{"type":45,"tag":70,"props":1969,"children":1970},{},[1971],{"type":50,"value":1972},"Monitor with Query 7 for progress",{"type":45,"tag":200,"props":1974,"children":1976},{"id":1975},"workflow-3-automatic-job-health-check",[1977],{"type":50,"value":1978},"Workflow 3: Automatic Job Health Check",{"type":45,"tag":53,"props":1980,"children":1981},{},[1982,1986],{"type":45,"tag":109,"props":1983,"children":1984},{},[1985],{"type":50,"value":1599},{"type":50,"value":1987}," Proactive monitoring of automatic background jobs.",{"type":45,"tag":1603,"props":1989,"children":1990},{},[1991,2060,2081,2107],{"type":45,"tag":70,"props":1992,"children":1993},{},[1994,1999],{"type":45,"tag":109,"props":1995,"children":1996},{},[1997],{"type":50,"value":1998},"Check AUTO CREATE STATS frequency:",{"type":45,"tag":212,"props":2000,"children":2002},{"className":214,"code":2001,"language":216,"meta":217,"style":217},"-- Use Query 5 to see recent automatic statistics jobs\nSELECT job_type, status, COUNT(*) AS job_count,\n       MAX(created) AS most_recent\nFROM [SHOW AUTOMATIC JOBS]\nWHERE created > now() - INTERVAL '24 hours'\n  AND job_type = 'AUTO CREATE STATS'\nGROUP BY job_type, status;\n",[2003],{"type":45,"tag":76,"props":2004,"children":2005},{"__ignoreMap":217},[2006,2014,2022,2030,2037,2044,2052],{"type":45,"tag":223,"props":2007,"children":2008},{"class":225,"line":226},[2009],{"type":45,"tag":223,"props":2010,"children":2011},{},[2012],{"type":50,"value":2013},"-- Use Query 5 to see recent automatic statistics jobs\n",{"type":45,"tag":223,"props":2015,"children":2016},{"class":225,"line":26},[2017],{"type":45,"tag":223,"props":2018,"children":2019},{},[2020],{"type":50,"value":2021},"SELECT job_type, status, COUNT(*) AS job_count,\n",{"type":45,"tag":223,"props":2023,"children":2024},{"class":225,"line":22},[2025],{"type":45,"tag":223,"props":2026,"children":2027},{},[2028],{"type":50,"value":2029},"       MAX(created) AS most_recent\n",{"type":45,"tag":223,"props":2031,"children":2032},{"class":225,"line":251},[2033],{"type":45,"tag":223,"props":2034,"children":2035},{},[2036],{"type":50,"value":1114},{"type":45,"tag":223,"props":2038,"children":2039},{"class":225,"line":260},[2040],{"type":45,"tag":223,"props":2041,"children":2042},{},[2043],{"type":50,"value":1122},{"type":45,"tag":223,"props":2045,"children":2046},{"class":225,"line":269},[2047],{"type":45,"tag":223,"props":2048,"children":2049},{},[2050],{"type":50,"value":2051},"  AND job_type = 'AUTO CREATE STATS'\n",{"type":45,"tag":223,"props":2053,"children":2054},{"class":225,"line":278},[2055],{"type":45,"tag":223,"props":2056,"children":2057},{},[2058],{"type":50,"value":2059},"GROUP BY job_type, status;\n",{"type":45,"tag":70,"props":2061,"children":2062},{},[2063,2068],{"type":45,"tag":109,"props":2064,"children":2065},{},[2066],{"type":50,"value":2067},"Expected pattern:",{"type":45,"tag":66,"props":2069,"children":2070},{},[2071,2076],{"type":45,"tag":70,"props":2072,"children":2073},{},[2074],{"type":50,"value":2075},"Multiple successful AUTO CREATE STATS jobs per day (depends on table update frequency)",{"type":45,"tag":70,"props":2077,"children":2078},{},[2079],{"type":50,"value":2080},"Regular AUTO SQL STATS COMPACTION (typically once per hour)",{"type":45,"tag":70,"props":2082,"children":2083},{},[2084,2089],{"type":45,"tag":109,"props":2085,"children":2086},{},[2087],{"type":50,"value":2088},"Warning signs:",{"type":45,"tag":66,"props":2090,"children":2091},{},[2092,2097,2102],{"type":45,"tag":70,"props":2093,"children":2094},{},[2095],{"type":50,"value":2096},"No AUTO CREATE STATS in last 24h: Statistics collection may be disabled",{"type":45,"tag":70,"props":2098,"children":2099},{},[2100],{"type":50,"value":2101},"High failure rate: Check cluster resource constraints or permission issues",{"type":45,"tag":70,"props":2103,"children":2104},{},[2105],{"type":50,"value":2106},"No AUTO SQL STATS COMPACTION: Stats table may grow unbounded",{"type":45,"tag":70,"props":2108,"children":2109},{},[2110,2115],{"type":45,"tag":109,"props":2111,"children":2112},{},[2113],{"type":50,"value":2114},"Verify settings:",{"type":45,"tag":212,"props":2116,"children":2118},{"className":214,"code":2117,"language":216,"meta":217,"style":217},"SHOW CLUSTER SETTING sql.stats.automatic_collection.enabled;  -- Should be true\nSHOW CLUSTER SETTING sql.stats.automatic_collection.min_stale_rows;\n",[2119],{"type":45,"tag":76,"props":2120,"children":2121},{"__ignoreMap":217},[2122,2130],{"type":45,"tag":223,"props":2123,"children":2124},{"class":225,"line":226},[2125],{"type":45,"tag":223,"props":2126,"children":2127},{},[2128],{"type":50,"value":2129},"SHOW CLUSTER SETTING sql.stats.automatic_collection.enabled;  -- Should be true\n",{"type":45,"tag":223,"props":2131,"children":2132},{"class":225,"line":26},[2133],{"type":45,"tag":223,"props":2134,"children":2135},{},[2136],{"type":50,"value":2137},"SHOW CLUSTER SETTING sql.stats.automatic_collection.min_stale_rows;\n",{"type":45,"tag":200,"props":2139,"children":2141},{"id":2140},"workflow-4-long-running-job-monitoring",[2142],{"type":50,"value":2143},"Workflow 4: Long-Running Job Monitoring",{"type":45,"tag":53,"props":2145,"children":2146},{},[2147,2151],{"type":45,"tag":109,"props":2148,"children":2149},{},[2150],{"type":50,"value":1599},{"type":50,"value":2152}," Track progress of expected long-running operations.",{"type":45,"tag":1603,"props":2154,"children":2155},{},[2156,2239,2270,2292],{"type":45,"tag":70,"props":2157,"children":2158},{},[2159,2164],{"type":45,"tag":109,"props":2160,"children":2161},{},[2162],{"type":50,"value":2163},"Identify long-running jobs:",{"type":45,"tag":212,"props":2165,"children":2167},{"className":214,"code":2166,"language":216,"meta":217,"style":217},"-- Use Query 2 with custom threshold\nWITH j AS (SHOW JOBS)\nSELECT job_id, job_type, description,\n       now() - created AS running_for,\n       fraction_completed\nFROM j\nWHERE status = 'running'\n  AND created \u003C now() - INTERVAL '30 minutes'\nORDER BY created;\n",[2168],{"type":45,"tag":76,"props":2169,"children":2170},{"__ignoreMap":217},[2171,2179,2186,2194,2202,2210,2217,2224,2232],{"type":45,"tag":223,"props":2172,"children":2173},{"class":225,"line":226},[2174],{"type":45,"tag":223,"props":2175,"children":2176},{},[2177],{"type":50,"value":2178},"-- Use Query 2 with custom threshold\n",{"type":45,"tag":223,"props":2180,"children":2181},{"class":225,"line":26},[2182],{"type":45,"tag":223,"props":2183,"children":2184},{},[2185],{"type":50,"value":240},{"type":45,"tag":223,"props":2187,"children":2188},{"class":225,"line":22},[2189],{"type":45,"tag":223,"props":2190,"children":2191},{},[2192],{"type":50,"value":2193},"SELECT job_id, job_type, description,\n",{"type":45,"tag":223,"props":2195,"children":2196},{"class":225,"line":251},[2197],{"type":45,"tag":223,"props":2198,"children":2199},{},[2200],{"type":50,"value":2201},"       now() - created AS running_for,\n",{"type":45,"tag":223,"props":2203,"children":2204},{"class":225,"line":260},[2205],{"type":45,"tag":223,"props":2206,"children":2207},{},[2208],{"type":50,"value":2209},"       fraction_completed\n",{"type":45,"tag":223,"props":2211,"children":2212},{"class":225,"line":269},[2213],{"type":45,"tag":223,"props":2214,"children":2215},{},[2216],{"type":50,"value":320},{"type":45,"tag":223,"props":2218,"children":2219},{"class":225,"line":278},[2220],{"type":45,"tag":223,"props":2221,"children":2222},{},[2223],{"type":50,"value":554},{"type":45,"tag":223,"props":2225,"children":2226},{"class":225,"line":287},[2227],{"type":45,"tag":223,"props":2228,"children":2229},{},[2230],{"type":50,"value":2231},"  AND created \u003C now() - INTERVAL '30 minutes'\n",{"type":45,"tag":223,"props":2233,"children":2234},{"class":225,"line":296},[2235],{"type":45,"tag":223,"props":2236,"children":2237},{},[2238],{"type":50,"value":1673},{"type":45,"tag":70,"props":2240,"children":2241},{},[2242,2247],{"type":45,"tag":109,"props":2243,"children":2244},{},[2245],{"type":50,"value":2246},"Monitor progress over time:",{"type":45,"tag":212,"props":2248,"children":2250},{"className":214,"code":2249,"language":216,"meta":217,"style":217},"-- Re-run every 10-15 minutes, track fraction_completed changes\n-- Example: 0.25 → 0.40 → 0.55 indicates steady progress\n",[2251],{"type":45,"tag":76,"props":2252,"children":2253},{"__ignoreMap":217},[2254,2262],{"type":45,"tag":223,"props":2255,"children":2256},{"class":225,"line":226},[2257],{"type":45,"tag":223,"props":2258,"children":2259},{},[2260],{"type":50,"value":2261},"-- Re-run every 10-15 minutes, track fraction_completed changes\n",{"type":45,"tag":223,"props":2263,"children":2264},{"class":225,"line":26},[2265],{"type":45,"tag":223,"props":2266,"children":2267},{},[2268],{"type":50,"value":2269},"-- Example: 0.25 → 0.40 → 0.55 indicates steady progress\n",{"type":45,"tag":70,"props":2271,"children":2272},{},[2273,2278],{"type":45,"tag":109,"props":2274,"children":2275},{},[2276],{"type":50,"value":2277},"Estimate completion:",{"type":45,"tag":212,"props":2279,"children":2281},{"className":214,"code":2280,"language":216,"meta":217,"style":217},"-- Use Query 7 for backup\u002Frestore jobs with time estimates\n",[2282],{"type":45,"tag":76,"props":2283,"children":2284},{"__ignoreMap":217},[2285],{"type":45,"tag":223,"props":2286,"children":2287},{"class":225,"line":226},[2288],{"type":45,"tag":223,"props":2289,"children":2290},{},[2291],{"type":50,"value":2280},{"type":45,"tag":70,"props":2293,"children":2294},{},[2295,2300],{"type":45,"tag":109,"props":2296,"children":2297},{},[2298],{"type":50,"value":2299},"Decide on action:",{"type":45,"tag":66,"props":2301,"children":2302},{},[2303,2308,2317],{"type":45,"tag":70,"props":2304,"children":2305},{},[2306],{"type":50,"value":2307},"Steady progress: Continue monitoring",{"type":45,"tag":70,"props":2309,"children":2310},{},[2311,2313],{"type":50,"value":2312},"Stalled progress (fraction_completed not increasing): Investigate with ",{"type":45,"tag":117,"props":2314,"children":2315},{"href":119},[2316],{"type":50,"value":122},{"type":45,"tag":70,"props":2318,"children":2319},{},[2320],{"type":50,"value":2321},"Failed: Use Query 1 to check error",{"type":45,"tag":59,"props":2323,"children":2325},{"id":2324},"safety-considerations",[2326],{"type":50,"value":2327},"Safety Considerations",{"type":45,"tag":53,"props":2329,"children":2330},{},[2331,2336,2338,2343,2344,2349],{"type":45,"tag":109,"props":2332,"children":2333},{},[2334],{"type":50,"value":2335},"Read-only operations (all diagnostic queries):",{"type":50,"value":2337},"\nAll ",{"type":45,"tag":76,"props":2339,"children":2341},{"className":2340},[],[2342],{"type":50,"value":150},{"type":50,"value":184},{"type":45,"tag":76,"props":2345,"children":2347},{"className":2346},[],[2348],{"type":50,"value":169},{"type":50,"value":2350}," queries are read-only and safe to run in production. No performance impact on cluster operations.",{"type":45,"tag":53,"props":2352,"children":2353},{},[2354],{"type":45,"tag":109,"props":2355,"children":2356},{},[2357],{"type":50,"value":2358},"Job control operations (opt-in):",{"type":45,"tag":53,"props":2360,"children":2361},{},[2362],{"type":45,"tag":109,"props":2363,"children":2364},{},[2365],{"type":50,"value":2366},"CAUTION: Pausing or canceling jobs can have data integrity implications",{"type":45,"tag":53,"props":2368,"children":2369},{},[2370],{"type":50,"value":2371},"Only proceed with job control if:",{"type":45,"tag":66,"props":2373,"children":2374},{},[2375,2387,2392,2397],{"type":45,"tag":70,"props":2376,"children":2377},{},[2378,2380,2385],{"type":50,"value":2379},"You have ",{"type":45,"tag":76,"props":2381,"children":2383},{"className":2382},[],[2384],{"type":50,"value":89},{"type":50,"value":2386}," role option",{"type":45,"tag":70,"props":2388,"children":2389},{},[2390],{"type":50,"value":2391},"You understand the implications (e.g., canceling a schema change mid-execution may require manual cleanup)",{"type":45,"tag":70,"props":2393,"children":2394},{},[2395],{"type":50,"value":2396},"You have authorization to interrupt cluster operations",{"type":45,"tag":70,"props":2398,"children":2399},{},[2400],{"type":50,"value":2401},"You've verified the job is truly problematic (not just slow)",{"type":45,"tag":53,"props":2403,"children":2404},{},[2405],{"type":45,"tag":109,"props":2406,"children":2407},{},[2408],{"type":50,"value":2409},"Job control commands:",{"type":45,"tag":212,"props":2411,"children":2413},{"className":214,"code":2412,"language":216,"meta":217,"style":217},"-- Pause a running job (can be resumed later)\nPAUSE JOB \u003Cjob_id>;\n\n-- Resume a paused job\nRESUME JOB \u003Cjob_id>;\n\n-- Cancel a job (terminal - cannot be resumed)\nCANCEL JOB \u003Cjob_id>;\n",[2414],{"type":45,"tag":76,"props":2415,"children":2416},{"__ignoreMap":217},[2417,2425,2433,2442,2450,2458,2465,2473],{"type":45,"tag":223,"props":2418,"children":2419},{"class":225,"line":226},[2420],{"type":45,"tag":223,"props":2421,"children":2422},{},[2423],{"type":50,"value":2424},"-- Pause a running job (can be resumed later)\n",{"type":45,"tag":223,"props":2426,"children":2427},{"class":225,"line":26},[2428],{"type":45,"tag":223,"props":2429,"children":2430},{},[2431],{"type":50,"value":2432},"PAUSE JOB \u003Cjob_id>;\n",{"type":45,"tag":223,"props":2434,"children":2435},{"class":225,"line":22},[2436],{"type":45,"tag":223,"props":2437,"children":2439},{"emptyLinePlaceholder":2438},true,[2440],{"type":50,"value":2441},"\n",{"type":45,"tag":223,"props":2443,"children":2444},{"class":225,"line":251},[2445],{"type":45,"tag":223,"props":2446,"children":2447},{},[2448],{"type":50,"value":2449},"-- Resume a paused job\n",{"type":45,"tag":223,"props":2451,"children":2452},{"class":225,"line":260},[2453],{"type":45,"tag":223,"props":2454,"children":2455},{},[2456],{"type":50,"value":2457},"RESUME JOB \u003Cjob_id>;\n",{"type":45,"tag":223,"props":2459,"children":2460},{"class":225,"line":269},[2461],{"type":45,"tag":223,"props":2462,"children":2463},{"emptyLinePlaceholder":2438},[2464],{"type":50,"value":2441},{"type":45,"tag":223,"props":2466,"children":2467},{"class":225,"line":278},[2468],{"type":45,"tag":223,"props":2469,"children":2470},{},[2471],{"type":50,"value":2472},"-- Cancel a job (terminal - cannot be resumed)\n",{"type":45,"tag":223,"props":2474,"children":2475},{"class":225,"line":287},[2476],{"type":45,"tag":223,"props":2477,"children":2478},{},[2479],{"type":50,"value":2480},"CANCEL JOB \u003Cjob_id>;\n",{"type":45,"tag":53,"props":2482,"children":2483},{},[2484],{"type":45,"tag":109,"props":2485,"children":2486},{},[2487],{"type":50,"value":2488},"Risks by job type:",{"type":45,"tag":66,"props":2490,"children":2491},{},[2492,2502,2512,2522],{"type":45,"tag":70,"props":2493,"children":2494},{},[2495,2500],{"type":45,"tag":109,"props":2496,"children":2497},{},[2498],{"type":50,"value":2499},"SCHEMA CHANGE:",{"type":50,"value":2501}," Canceling may leave schema in inconsistent state; prefer PAUSE and investigation",{"type":45,"tag":70,"props":2503,"children":2504},{},[2505,2510],{"type":45,"tag":109,"props":2506,"children":2507},{},[2508],{"type":50,"value":2509},"BACKUP:",{"type":50,"value":2511}," Canceling is safe (can retry); pausing is better for temporary issues",{"type":45,"tag":70,"props":2513,"children":2514},{},[2515,2520],{"type":45,"tag":109,"props":2516,"children":2517},{},[2518],{"type":50,"value":2519},"RESTORE:",{"type":50,"value":2521}," Canceling may leave database partially restored; requires cleanup",{"type":45,"tag":70,"props":2523,"children":2524},{},[2525,2530],{"type":45,"tag":109,"props":2526,"children":2527},{},[2528],{"type":50,"value":2529},"AUTO CREATE STATS:",{"type":50,"value":2531}," Canceling is safe (will retry later automatically)",{"type":45,"tag":53,"props":2533,"children":2534},{},[2535,2540],{"type":45,"tag":109,"props":2536,"children":2537},{},[2538],{"type":50,"value":2539},"Best practice:",{"type":50,"value":2541}," Focus on monitoring and diagnosis; only use control operations when explicitly required and authorized.",{"type":45,"tag":53,"props":2543,"children":2544},{},[2545,2546,2552],{"type":50,"value":176},{"type":45,"tag":117,"props":2547,"children":2549},{"href":2548},"references\u002Fpermissions.md",[2550],{"type":50,"value":2551},"permissions reference",{"type":50,"value":2553}," for CONTROLJOB role option setup.",{"type":45,"tag":59,"props":2555,"children":2557},{"id":2556},"troubleshooting",[2558],{"type":50,"value":2559},"Troubleshooting",{"type":45,"tag":2561,"props":2562,"children":2563},"table",{},[2564,2588],{"type":45,"tag":2565,"props":2566,"children":2567},"thead",{},[2568],{"type":45,"tag":2569,"props":2570,"children":2571},"tr",{},[2572,2578,2583],{"type":45,"tag":2573,"props":2574,"children":2575},"th",{},[2576],{"type":50,"value":2577},"Issue",{"type":45,"tag":2573,"props":2579,"children":2580},{},[2581],{"type":50,"value":2582},"Cause",{"type":45,"tag":2573,"props":2584,"children":2585},{},[2586],{"type":50,"value":2587},"Fix",{"type":45,"tag":2589,"props":2590,"children":2591},"tbody",{},[2592,2623,2655,2687,2710,2734,2763,2781],{"type":45,"tag":2569,"props":2593,"children":2594},{},[2595,2606,2611],{"type":45,"tag":2596,"props":2597,"children":2598},"td",{},[2599,2604],{"type":45,"tag":76,"props":2600,"children":2602},{"className":2601},[],[2603],{"type":50,"value":150},{"type":50,"value":2605}," returns empty",{"type":45,"tag":2596,"props":2607,"children":2608},{},[2609],{"type":50,"value":2610},"No jobs in last 12h, or insufficient privileges",{"type":45,"tag":2596,"props":2612,"children":2613},{},[2614,2616,2621],{"type":50,"value":2615},"Grant ",{"type":45,"tag":76,"props":2617,"children":2619},{"className":2618},[],[2620],{"type":50,"value":81},{"type":50,"value":2622}," privilege; verify cluster has recent job activity",{"type":45,"tag":2569,"props":2624,"children":2625},{},[2626,2631,2636],{"type":45,"tag":2596,"props":2627,"children":2628},{},[2629],{"type":50,"value":2630},"\"waiting for MVCC GC\" for many hours",{"type":45,"tag":2596,"props":2632,"children":2633},{},[2634],{"type":50,"value":2635},"Normal behavior for SCHEMA CHANGE GC after DROP operations",{"type":45,"tag":2596,"props":2637,"children":2638},{},[2639,2641,2646,2648,2653],{"type":50,"value":2640},"Wait up to ",{"type":45,"tag":76,"props":2642,"children":2644},{"className":2643},[],[2645],{"type":50,"value":959},{"type":50,"value":2647}," (default 4h); check the effective value with ",{"type":45,"tag":76,"props":2649,"children":2651},{"className":2650},[],[2652],{"type":50,"value":1001},{"type":50,"value":2654}," against the affected table\u002Fdatabase\u002Frange",{"type":45,"tag":2569,"props":2656,"children":2657},{},[2658,2663,2674],{"type":45,"tag":2596,"props":2659,"children":2660},{},[2661],{"type":50,"value":2662},"Can't pause\u002Fresume job: \"permission denied\"",{"type":45,"tag":2596,"props":2664,"children":2665},{},[2666,2668,2673],{"type":50,"value":2667},"Missing ",{"type":45,"tag":76,"props":2669,"children":2671},{"className":2670},[],[2672],{"type":50,"value":89},{"type":50,"value":2386},{"type":45,"tag":2596,"props":2675,"children":2676},{},[2677,2679,2685],{"type":50,"value":2678},"Use ",{"type":45,"tag":76,"props":2680,"children":2682},{"className":2681},[],[2683],{"type":50,"value":2684},"ALTER ROLE \u003Cusername> WITH CONTROLJOB",{"type":50,"value":2686}," (not GRANT SYSTEM)",{"type":45,"tag":2569,"props":2688,"children":2689},{},[2690,2700,2705],{"type":45,"tag":2596,"props":2691,"children":2692},{},[2693,2695],{"type":50,"value":2694},"Job stuck at same ",{"type":45,"tag":76,"props":2696,"children":2698},{"className":2697},[],[2699],{"type":50,"value":609},{"type":45,"tag":2596,"props":2701,"children":2702},{},[2703],{"type":50,"value":2704},"Job may be processing large batch, or actually stuck",{"type":45,"tag":2596,"props":2706,"children":2707},{},[2708],{"type":50,"value":2709},"Wait 15-30 min and re-check; if no change, investigate with live query triage",{"type":45,"tag":2569,"props":2711,"children":2712},{},[2713,2718,2723],{"type":45,"tag":2596,"props":2714,"children":2715},{},[2716],{"type":50,"value":2717},"No AUTO CREATE STATS jobs",{"type":45,"tag":2596,"props":2719,"children":2720},{},[2721],{"type":50,"value":2722},"Automatic collection disabled",{"type":45,"tag":2596,"props":2724,"children":2725},{},[2726,2728],{"type":50,"value":2727},"Check ",{"type":45,"tag":76,"props":2729,"children":2731},{"className":2730},[],[2732],{"type":50,"value":2733},"sql.stats.automatic_collection.enabled = true",{"type":45,"tag":2569,"props":2735,"children":2736},{},[2737,2747,2752],{"type":45,"tag":2596,"props":2738,"children":2739},{},[2740,2745],{"type":45,"tag":76,"props":2741,"children":2743},{"className":2742},[],[2744],{"type":50,"value":169},{"type":50,"value":2746}," shows old jobs only",{"type":45,"tag":2596,"props":2748,"children":2749},{},[2750],{"type":50,"value":2751},"Need to filter by time window",{"type":45,"tag":2596,"props":2753,"children":2754},{},[2755,2757],{"type":50,"value":2756},"Add ",{"type":45,"tag":76,"props":2758,"children":2760},{"className":2759},[],[2761],{"type":50,"value":2762},"WHERE created > now() - INTERVAL '24 hours'",{"type":45,"tag":2569,"props":2764,"children":2765},{},[2766,2771,2776],{"type":45,"tag":2596,"props":2767,"children":2768},{},[2769],{"type":50,"value":2770},"Failed job with \"schema change GC\" error",{"type":45,"tag":2596,"props":2772,"children":2773},{},[2774],{"type":50,"value":2775},"Expected for post-DROP cleanup failures",{"type":45,"tag":2596,"props":2777,"children":2778},{},[2779],{"type":50,"value":2780},"Usually safe to ignore; job will retry automatically",{"type":45,"tag":2569,"props":2782,"children":2783},{},[2784,2789,2794],{"type":45,"tag":2596,"props":2785,"children":2786},{},[2787],{"type":50,"value":2788},"Job error: \"concurrent schema change\"",{"type":45,"tag":2596,"props":2790,"children":2791},{},[2792],{"type":50,"value":2793},"Multiple schema changes on same table",{"type":45,"tag":2596,"props":2795,"children":2796},{},[2797],{"type":50,"value":2798},"Wait for first schema change to complete, then retry",{"type":45,"tag":59,"props":2800,"children":2802},{"id":2801},"key-considerations",[2803],{"type":50,"value":2804},"Key Considerations",{"type":45,"tag":66,"props":2806,"children":2807},{},[2808,2825,2835,2845],{"type":45,"tag":70,"props":2809,"children":2810},{},[2811,2816,2818,2823],{"type":45,"tag":109,"props":2812,"children":2813},{},[2814],{"type":50,"value":2815},"MVCC GC waiting:",{"type":50,"value":2817}," Normal for post-DROP cleanup; duration tied to the zone-level ",{"type":45,"tag":76,"props":2819,"children":2821},{"className":2820},[],[2822],{"type":50,"value":959},{"type":50,"value":2824}," (default 4h)",{"type":45,"tag":70,"props":2826,"children":2827},{},[2828,2833],{"type":45,"tag":109,"props":2829,"children":2830},{},[2831],{"type":50,"value":2832},"Automatic job health:",{"type":50,"value":2834}," Regular AUTO CREATE STATS is critical for query optimizer performance",{"type":45,"tag":70,"props":2836,"children":2837},{},[2838,2843],{"type":45,"tag":109,"props":2839,"children":2840},{},[2841],{"type":50,"value":2842},"Job control:",{"type":50,"value":2844}," PAUSE is safer than CANCEL; some cancellations require manual cleanup",{"type":45,"tag":70,"props":2846,"children":2847},{},[2848,2853,2854,2859],{"type":45,"tag":109,"props":2849,"children":2850},{},[2851],{"type":50,"value":2852},"Progress:",{"type":50,"value":115},{"type":45,"tag":76,"props":2855,"children":2857},{"className":2856},[],[2858],{"type":50,"value":609},{"type":50,"value":2860}," may be NULL for some job types",{"type":45,"tag":59,"props":2862,"children":2864},{"id":2863},"references",[2865],{"type":50,"value":2866},"References",{"type":45,"tag":53,"props":2868,"children":2869},{},[2870],{"type":45,"tag":109,"props":2871,"children":2872},{},[2873],{"type":50,"value":2874},"Skill references:",{"type":45,"tag":66,"props":2876,"children":2877},{},[2878,2886,2894,2902],{"type":45,"tag":70,"props":2879,"children":2880},{},[2881],{"type":45,"tag":117,"props":2882,"children":2883},{"href":2548},[2884],{"type":50,"value":2885},"RBAC and privilege setup",{"type":45,"tag":70,"props":2887,"children":2888},{},[2889],{"type":45,"tag":117,"props":2890,"children":2891},{"href":187},[2892],{"type":50,"value":2893},"Job states and transitions",{"type":45,"tag":70,"props":2895,"children":2896},{},[2897],{"type":45,"tag":117,"props":2898,"children":2899},{"href":179},[2900],{"type":50,"value":2901},"Job types catalog",{"type":45,"tag":70,"props":2903,"children":2904},{},[2905],{"type":45,"tag":117,"props":2906,"children":2908},{"href":2907},"references\u002Fsql-query-variations.md",[2909],{"type":50,"value":2910},"SQL query variations",{"type":45,"tag":53,"props":2912,"children":2913},{},[2914],{"type":45,"tag":109,"props":2915,"children":2916},{},[2917],{"type":50,"value":113},{"type":45,"tag":66,"props":2919,"children":2920},{},[2921,2930],{"type":45,"tag":70,"props":2922,"children":2923},{},[2924,2928],{"type":45,"tag":117,"props":2925,"children":2926},{"href":119},[2927],{"type":50,"value":122},{"type":50,"value":2929}," - For live query monitoring (job-executed statements may not appear)",{"type":45,"tag":70,"props":2931,"children":2932},{},[2933,2937],{"type":45,"tag":117,"props":2934,"children":2935},{"href":127},[2936],{"type":50,"value":130},{"type":50,"value":2938}," - For historical query analysis (background jobs excluded)",{"type":45,"tag":53,"props":2940,"children":2941},{},[2942],{"type":45,"tag":109,"props":2943,"children":2944},{},[2945],{"type":50,"value":2946},"Official CockroachDB Documentation:",{"type":45,"tag":66,"props":2948,"children":2949},{},[2950,2960,2969,2979,2989,2999,3009,3019],{"type":45,"tag":70,"props":2951,"children":2952},{},[2953],{"type":45,"tag":117,"props":2954,"children":2958},{"href":2955,"rel":2956},"https:\u002F\u002Fwww.cockroachlabs.com\u002Fdocs\u002Fstable\u002Fshow-jobs.html",[2957],"nofollow",[2959],{"type":50,"value":150},{"type":45,"tag":70,"props":2961,"children":2962},{},[2963],{"type":45,"tag":117,"props":2964,"children":2967},{"href":2965,"rel":2966},"https:\u002F\u002Fwww.cockroachlabs.com\u002Fdocs\u002Fstable\u002Fshow-automatic-jobs.html",[2957],[2968],{"type":50,"value":169},{"type":45,"tag":70,"props":2970,"children":2971},{},[2972],{"type":45,"tag":117,"props":2973,"children":2976},{"href":2974,"rel":2975},"https:\u002F\u002Fwww.cockroachlabs.com\u002Fdocs\u002Fstable\u002Fpause-job.html",[2957],[2977],{"type":50,"value":2978},"PAUSE JOB",{"type":45,"tag":70,"props":2980,"children":2981},{},[2982],{"type":45,"tag":117,"props":2983,"children":2986},{"href":2984,"rel":2985},"https:\u002F\u002Fwww.cockroachlabs.com\u002Fdocs\u002Fstable\u002Fresume-job.html",[2957],[2987],{"type":50,"value":2988},"RESUME JOB",{"type":45,"tag":70,"props":2990,"children":2991},{},[2992],{"type":45,"tag":117,"props":2993,"children":2996},{"href":2994,"rel":2995},"https:\u002F\u002Fwww.cockroachlabs.com\u002Fdocs\u002Fstable\u002Fcancel-job.html",[2957],[2997],{"type":50,"value":2998},"CANCEL JOB",{"type":45,"tag":70,"props":3000,"children":3001},{},[3002],{"type":45,"tag":117,"props":3003,"children":3006},{"href":3004,"rel":3005},"https:\u002F\u002Fwww.cockroachlabs.com\u002Fdocs\u002Fstable\u002Fcrdb-internal.html",[2957],[3007],{"type":50,"value":3008},"crdb_internal",{"type":45,"tag":70,"props":3010,"children":3011},{},[3012],{"type":45,"tag":117,"props":3013,"children":3016},{"href":3014,"rel":3015},"https:\u002F\u002Fwww.cockroachlabs.com\u002Fdocs\u002Fstable\u002Fui-jobs-page.html",[2957],[3017],{"type":50,"value":3018},"Jobs Page (DB Console)",{"type":45,"tag":70,"props":3020,"children":3021},{},[3022],{"type":45,"tag":117,"props":3023,"children":3026},{"href":3024,"rel":3025},"https:\u002F\u002Fwww.cockroachlabs.com\u002Fdocs\u002Fstable\u002Fsecurity-reference\u002Fauthorization.html#supported-privileges",[2957],[3027],{"type":50,"value":3028},"VIEWJOB privilege",{"type":45,"tag":3030,"props":3031,"children":3032},"style",{},[3033],{"type":50,"value":3034},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":3036,"total":3195},[3037,3054,3070,3085,3096,3106,3117,3129,3143,3158,3169,3182],{"slug":3038,"name":3038,"fn":3039,"description":3040,"org":3041,"tags":3042,"stars":3051,"repoUrl":3052,"updatedAt":3053},"collecting-cockroachdb-operator-escalation-packet","collect CockroachDB operator escalation packets","Collects a complete CockroachDB Operator escalation packet for TSC\u002FTSE or operator-team handoff, including Helm state, Kubernetes resources, logs, operation-specific evidence, pprof goroutine dumps, metrics, and a customer action timeline. Use when general diagnosis cannot resolve an operator-managed CockroachDB Helm issue or before restarting a stuck operator.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3043,3044,3047,3050],{"name":20,"slug":21,"type":15},{"name":3045,"slug":3046,"type":15},"Incident Response","incident-response",{"name":3048,"slug":3049,"type":15},"Kubernetes","kubernetes",{"name":17,"slug":18,"type":15},105,"https:\u002F\u002Fgithub.com\u002Fcockroachdb\u002Fhelm-charts","2026-07-12T07:57:25.288146",{"slug":3055,"name":3055,"fn":3056,"description":3057,"org":3058,"tags":3059,"stars":3051,"repoUrl":3052,"updatedAt":3069},"configuring-cockroachdb-helm-tls","configure TLS for CockroachDB Helm charts","Selects and validates TLS settings for CockroachDB Helm chart deployments, including self-signer, cert-manager, and external certificate modes. Use when a customer needs secure CockroachDB Helm values, certificate secret mapping, cert-manager integration, or TLS install troubleshooting before deploying the chart.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3060,3063,3066],{"name":3061,"slug":3062,"type":15},"Deployment","deployment",{"name":3064,"slug":3065,"type":15},"Encryption","encryption",{"name":3067,"slug":3068,"type":15},"Security","security","2026-07-12T07:56:37.675396",{"slug":3071,"name":3071,"fn":3072,"description":3073,"org":3074,"tags":3075,"stars":3051,"repoUrl":3052,"updatedAt":3084},"debugging-cockroachdb-operator-migrations","debug CockroachDB Operator migration scenarios","Debugs CockroachDB Operator migration scenarios, including Helm StatefulSet to v1beta1 CrdbNode migration and public operator v1alpha1 to v1beta1 migration. Use when migration labels, migration phases, source StatefulSet ownership, converted CRDs, PVC ownership, or post-migration reconciliation are unclear or stuck.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3076,3077,3080,3081],{"name":20,"slug":21,"type":15},{"name":3078,"slug":3079,"type":15},"Debugging","debugging",{"name":3048,"slug":3049,"type":15},{"name":3082,"slug":3083,"type":15},"Migration","migration","2026-07-12T07:56:48.360871",{"slug":3086,"name":3086,"fn":3087,"description":3088,"org":3089,"tags":3090,"stars":3051,"repoUrl":3052,"updatedAt":3095},"diagnosing-cockroachdb-helm-deployments","diagnose CockroachDB Helm chart deployments","Diagnoses failed or unhealthy CockroachDB Helm chart deployments by checking Helm release state, operator health, CrdbCluster and CrdbNode status, pod readiness, RBAC, webhooks, TLS, upgrades, scaling, PVCs, DNS, and multi-region assumptions. Use when Helm install or upgrade fails, pods are not Ready, or the operator is not reconciling.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3091,3092,3093,3094],{"name":20,"slug":21,"type":15},{"name":3078,"slug":3079,"type":15},{"name":3061,"slug":3062,"type":15},{"name":3048,"slug":3049,"type":15},"2026-07-12T07:57:24.018818",{"slug":3097,"name":3097,"fn":3098,"description":3099,"org":3100,"tags":3101,"stars":3051,"repoUrl":3052,"updatedAt":3105},"installing-cockroachdb-with-helm","install CockroachDB using Helm","Guides customer-facing installation of CockroachDB on Kubernetes using the CockroachDB split Helm charts and operator-managed v1beta1 resources. Use when installing CockroachDB with Helm, choosing between published and local split charts, verifying a new install, or helping an agent complete first-time Kubernetes onboarding.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3102,3103,3104],{"name":20,"slug":21,"type":15},{"name":3061,"slug":3062,"type":15},{"name":3048,"slug":3049,"type":15},"2026-07-12T07:56:45.777567",{"slug":3107,"name":3107,"fn":3108,"description":3109,"org":3110,"tags":3111,"stars":3051,"repoUrl":3052,"updatedAt":3116},"validating-cockroachdb-helm-multiregion","validate CockroachDB multi-region Helm deployments","Validates CockroachDB Helm chart values and Kubernetes prerequisites for operator-managed multi-region deployments. Use before adding a region, deploying CockroachDB across multiple Kubernetes clusters, checking region DNS domains, or confirming that all regions share certificate and networking assumptions.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3112,3113,3114,3115],{"name":20,"slug":21,"type":15},{"name":3061,"slug":3062,"type":15},{"name":3048,"slug":3049,"type":15},{"name":13,"slug":14,"type":15},"2026-07-12T07:56:47.082609",{"slug":3118,"name":3118,"fn":3119,"description":3120,"org":3121,"tags":3122,"stars":22,"repoUrl":23,"updatedAt":3128},"analyzing-range-distribution","analyze CockroachDB range distribution and health","Analyzes CockroachDB range distribution across tables and indexes using SHOW RANGES to identify range count, size patterns, leaseholder placement, and replication health. Use when investigating hotspots, uneven data distribution, range fragmentation, or validating zone configuration effects without DB Console access.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3123,3124,3125],{"name":20,"slug":21,"type":15},{"name":17,"slug":18,"type":15},{"name":3126,"slug":3127,"type":15},"Performance","performance","2026-07-12T07:57:18.753533",{"slug":3130,"name":3130,"fn":3131,"description":3132,"org":3133,"tags":3134,"stars":22,"repoUrl":23,"updatedAt":3142},"analyzing-schema-change-storage-risk","analyze schema change storage requirements","Estimates storage requirements for CockroachDB online schema change backfills using SHOW RANGES WITH DETAILS, KEYS, INDEXES. Use before CREATE INDEX, ADD COLUMN with INDEX\u002FUNIQUE, ALTER PRIMARY KEY, CREATE MATERIALIZED VIEW, CREATE TABLE AS, REFRESH, or SET LOCALITY on tables with large per-index footprints, to avoid mid-backfill disk exhaustion.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3135,3138,3139,3140],{"name":3136,"slug":3137,"type":15},"Data Modeling","data-modeling",{"name":20,"slug":21,"type":15},{"name":3126,"slug":3127,"type":15},{"name":3141,"slug":216,"type":15},"SQL","2026-07-12T07:57:22.763788",{"slug":3144,"name":3144,"fn":3145,"description":3146,"org":3147,"tags":3148,"stars":22,"repoUrl":23,"updatedAt":3157},"auditing-cis-benchmark","audit CockroachDB clusters against CIS benchmarks","Audits a self-hosted CockroachDB cluster against the CIS CockroachDB Benchmark v1.0.0 Level 1 controls. Supports two audit depths — quick automated scans and full CIS audit procedures. Produces a structured PASS\u002FFAIL\u002FMANUAL report covering installation, system hardening, logging, user access, data protection, and CockroachDB settings. Use when preparing for CIS compliance assessments, hardening self-hosted deployments, or validating security posture against industry benchmarks.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3149,3152,3155,3156],{"name":3150,"slug":3151,"type":15},"Audit","audit",{"name":3153,"slug":3154,"type":15},"Compliance","compliance",{"name":20,"slug":21,"type":15},{"name":3067,"slug":3068,"type":15},"2026-07-18T05:48:00.862384",{"slug":3159,"name":3159,"fn":3160,"description":3161,"org":3162,"tags":3163,"stars":22,"repoUrl":23,"updatedAt":3168},"auditing-cloud-cluster-security","audit CockroachDB cluster security posture","Audits the security posture of a CockroachDB cluster (Cloud or self-hosted) across network, authentication, authorization, encryption, audit logging, and backup dimensions. Use when assessing cluster security readiness, preparing for compliance reviews, or investigating security configuration gaps.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3164,3165,3166,3167],{"name":3150,"slug":3151,"type":15},{"name":20,"slug":21,"type":15},{"name":13,"slug":14,"type":15},{"name":3067,"slug":3068,"type":15},"2026-07-12T07:57:01.506735",{"slug":3170,"name":3170,"fn":3171,"description":3172,"org":3173,"tags":3174,"stars":22,"repoUrl":23,"updatedAt":3181},"auditing-table-statistics","audit optimizer table statistics","Audits optimizer table statistics for staleness, missing coverage, and data quality issues using SHOW STATISTICS. Use when diagnosing poor query performance, unexpected plan changes, or after bulk data changes to identify stale statistics requiring refresh via CREATE STATISTICS.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3175,3176,3179,3180],{"name":3150,"slug":3151,"type":15},{"name":3177,"slug":3178,"type":15},"Data Analysis","data-analysis",{"name":20,"slug":21,"type":15},{"name":3126,"slug":3127,"type":15},"2026-07-12T07:57:16.190081",{"slug":3183,"name":3183,"fn":3184,"description":3185,"org":3186,"tags":3187,"stars":22,"repoUrl":23,"updatedAt":3194},"benchmarking-transaction-patterns","benchmark CockroachDB transaction patterns","Guides benchmarking and comparing explicit multi-statement transactions versus single-statement CTE transactions in CockroachDB, with fair test methodology, contention analysis, and performance interpretation. Use when comparing transaction formulations, benchmarking CockroachDB workloads under contention, investigating retry pressure, or deciding whether to rewrite multi-step application flows into single SQL statements.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3188,3189,3192,3193],{"name":20,"slug":21,"type":15},{"name":3190,"slug":3191,"type":15},"Engineering","engineering",{"name":3126,"slug":3127,"type":15},{"name":3141,"slug":216,"type":15},"2026-07-12T07:57:26.543278",40,{"items":3197,"total":3249},[3198,3204,3211,3218,3225,3232,3239],{"slug":3118,"name":3118,"fn":3119,"description":3120,"org":3199,"tags":3200,"stars":22,"repoUrl":23,"updatedAt":3128},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3201,3202,3203],{"name":20,"slug":21,"type":15},{"name":17,"slug":18,"type":15},{"name":3126,"slug":3127,"type":15},{"slug":3130,"name":3130,"fn":3131,"description":3132,"org":3205,"tags":3206,"stars":22,"repoUrl":23,"updatedAt":3142},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3207,3208,3209,3210],{"name":3136,"slug":3137,"type":15},{"name":20,"slug":21,"type":15},{"name":3126,"slug":3127,"type":15},{"name":3141,"slug":216,"type":15},{"slug":3144,"name":3144,"fn":3145,"description":3146,"org":3212,"tags":3213,"stars":22,"repoUrl":23,"updatedAt":3157},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3214,3215,3216,3217],{"name":3150,"slug":3151,"type":15},{"name":3153,"slug":3154,"type":15},{"name":20,"slug":21,"type":15},{"name":3067,"slug":3068,"type":15},{"slug":3159,"name":3159,"fn":3160,"description":3161,"org":3219,"tags":3220,"stars":22,"repoUrl":23,"updatedAt":3168},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3221,3222,3223,3224],{"name":3150,"slug":3151,"type":15},{"name":20,"slug":21,"type":15},{"name":13,"slug":14,"type":15},{"name":3067,"slug":3068,"type":15},{"slug":3170,"name":3170,"fn":3171,"description":3172,"org":3226,"tags":3227,"stars":22,"repoUrl":23,"updatedAt":3181},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3228,3229,3230,3231],{"name":3150,"slug":3151,"type":15},{"name":3177,"slug":3178,"type":15},{"name":20,"slug":21,"type":15},{"name":3126,"slug":3127,"type":15},{"slug":3183,"name":3183,"fn":3184,"description":3185,"org":3233,"tags":3234,"stars":22,"repoUrl":23,"updatedAt":3194},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3235,3236,3237,3238],{"name":20,"slug":21,"type":15},{"name":3190,"slug":3191,"type":15},{"name":3126,"slug":3127,"type":15},{"name":3141,"slug":216,"type":15},{"slug":3240,"name":3240,"fn":3241,"description":3242,"org":3243,"tags":3244,"stars":22,"repoUrl":23,"updatedAt":3248},"cockroachdb-sql","write and optimize CockroachDB SQL","Use when writing, generating, or optimizing SQL for CockroachDB, designing CockroachDB schemas, or when the user asks about CockroachDB-specific SQL patterns, type mappings, and distributed database best practices. Also use when encountering CockroachDB anti-patterns like missing primary keys, sequential ID hotspots, or incorrect type usage.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3245,3246,3247],{"name":20,"slug":21,"type":15},{"name":3126,"slug":3127,"type":15},{"name":3141,"slug":216,"type":15},"2026-07-25T05:31:22.562808",34]