Reduce Unoptimized Query Oracle
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.
Run in terminal (recommended)
claude mcp add reduce-unoptimized-query-oracle npx -- -y @trustedskills/reduce-unoptimized-query-oracle
Or manually add to ~/.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-oracleroachtest. - 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-oracleroachtest failure. Can you help me find the failing SQL?" - "What's the Git commit hash used in this
unoptimized-query-oracletest failure log?" - "Are runtime assertions enabled in this
unoptimized-query-oracletest failure?"
Tips & gotchas
- The skill requires access to the artifacts directory from a failed
unoptimized-query-oracleroachtest. - 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 Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
🌐 Community
Passed automated security scans.