Reduce Unoptimized Query Oracle

🌐Community
by cockroachdb · vlatest · Repository

Identifies and suggests optimized SQL query rewrites from CockroachDB's execution plan analysis for faster performance.

Install on your platform

We auto-selected Claude Code based on this skill’s supported platforms.

1

Run in terminal (recommended)

terminal
claude mcp add reduce-unoptimized-query-oracle npx -- -y @trustedskills/reduce-unoptimized-query-oracle
2

Or manually add to ~/.claude/settings.json

~/.claude/settings.json
{
  "mcpServers": {
    "reduce-unoptimized-query-oracle": {
      "command": "npx",
      "args": [
        "-y",
        "@trustedskills/reduce-unoptimized-query-oracle"
      ]
    }
  }
}

Requires Claude Code (claude CLI). Run claude --version to verify your install.

About This Skill

What it does

This skill helps users reduce a test failure log from the unoptimized-query-oracle roachtest to its simplest, reproducible SQL query. The unoptimized-query-oracle test runs random SQL statements and compares results with different optimization settings; discrepancies indicate potential bugs in CockroachDB. This skill guides you through analyzing logs to isolate the problematic query.

When to use it

  • You encounter a failure from the unoptimized-query-oracle roachtest.
  • You need to identify the minimal SQL statement that triggers the test failure.
  • You are debugging issues related to CockroachDB's SQL query optimization.
  • You need to understand the configuration and environment variables used during a failed roachtest run.

Key capabilities

  • Log Analysis: Identifies key files within an artifacts directory (params.log, test.log, failure*.log, unoptimized-query-oracle*.log, cockroach.log).
  • Configuration Determination: Extracts the Git commit hash, determines if runtime assertions are enabled, and identifies metamorphic settings from log files.
  • Environment Variable Identification: Retrieves environment variables used during the test execution.
  • Test Type Classification: Determines whether a test is single-region or multi-region.
  • Build Instructions: Provides commands for checking out code and building CockroachDB, including instructions for builds with runtime assertions enabled.

Example prompts

  • "I have an unoptimized-query-oracle roachtest failure. Can you help me find the failing SQL?"
  • "What's the Git commit hash used in this unoptimized-query-oracle test failure log?"
  • "Are runtime assertions enabled in this unoptimized-query-oracle test failure?"

Tips & gotchas

  • The skill requires access to the artifacts directory from a failed unoptimized-query-oracle roachtest.
  • Understanding Git and basic build commands is helpful for following the instructions provided by the skill.
  • Pay close attention to environment variables, as they can significantly impact test behavior.

Tags

🛡️

TrustedSkills Verification

Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.

Security Audits

Gen Agent Trust HubPass
SocketPass
SnykPass

Details

Version
vlatest
License
Author
cockroachdb
Installs
42

🌐 Community

Passed automated security scans.