starrocks-ai-query-autotuner

Convert StarRocks EXPLAIN COSTS plans into prioritized SQL optimization actions.

14|1|Updated May 5, 2026
One-click install
npx skills add https://github.com/ivanshamaev/de-agent-skills --skill starrocks-ai-query-autotuner
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: starrocks-ai-query-autotuner
Source: https://github.com/ivanshamaev/de-agent-skills/tree/main/group_skills/starrocks_group_skills/starrocks_ai_query_autotuner
Command: npx skills add https://github.com/ivanshamaev/de-agent-skills --skill starrocks-ai-query-autotuner

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pymysql.

What problem does it solve?

This Skill removes the manual, error-prone effort of diagnosing slow StarRocks queries by turning execution plans and slow-query signals into concrete optimization actions.

Core Features & Use Cases

  • Autonomous EXPLAIN COSTS Diagnosis: Extracts key plan signals, detects full scans, problematic joins (including cartesian patterns), and identifies likely missing partition constraints.
  • Stale Statistics Detection & Auto-ANALYZE Guidance: Checks statistics freshness via analysis job status and recommends async ANALYZE when needed.
  • Actionable Recommendations: Suggests materialized views, proposes index strategies (bitmap/bloom style), generates join-order and join-method hints, and recommends partition-filter rewrites.

Use Case Example: For a slow analytical query that scans many partitions and joins large datasets without selective filters, the Skill produces a prioritized plan of fixes (partition pruning rewrite, join hinting, and MV/index candidates) to reduce runtime.

Quick Start

Ask the AI to produce an autotuner report for a slow StarRocks SQL query by fetching EXPLAIN COSTS, classifying issues, checking statistics staleness, and returning a prioritized action list.

Frequently Asked Questions about starrocks-ai-query-autotuner

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I diagnose slow StarRocks queries using EXPLAIN COSTS?

Diagnosing slow StarRocks queries involves parsing EXPLAIN COSTS execution plans to detect full table scans, problematic joins, and missing partition constraints. This process classifies anti-patterns and generates prioritized SQL optimization actions to reduce OLAP workload runtime.

Why does my StarRocks SQL query skip partition pruning and scan everything?

StarRocks SQL partition pruning fails when queries lack selective filters or use inefficient partition constraints. Analyzing the EXPLAIN COSTS plan identifies these full scan anti-patterns, enabling partition-filter rewrites to restrict data access to relevant partitions.

How do I check stale statistics and run ANALYZE for StarRocks query optimization?

Checking stale StarRocks statistics requires inspecting ANALYZE job status via SHOW commands. When statistics are outdated, the system recommends running async ANALYZE jobs to refresh data distribution metrics for accurate query plan cost estimation.

What are the best ways to optimize StarRocks join strategies for large datasets?

Optimizing StarRocks join strategies involves generating join-order and join-method hints based on EXPLAIN COSTS analysis. For large dataset joins, applying these hints alongside materialized views and index options prevents cartesian patterns and improves execution efficiency.

Can I use materialized views and indexes to speed up StarRocks OLAP workloads?

Materialized views and index strategies like bitmap or bloom filters accelerate StarRocks OLAP workloads by pre-aggregating data and filtering rows. Recommendations are generated by analyzing slow-query evidence and execution plan costs.

Do I need pymysql to run StarRocks query autotuning locally?

Running StarRocks query autotuning locally requires the pymysql dependency to connect to the database, fetch EXPLAIN COSTS plans, check statistics staleness, and return prioritized SQL optimization actions for slow analytical queries.