starrocks-query-optimizer

Analyze StarRocks execution plans and runtime filters to optimize SQL performance.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

StarRocks query performance problems caused by inefficient execution plans, missing statistics, ineffective predicate pushdown, or absent runtime filters.

Core Features & Use Cases

  • Vectorized execution and pipeline tuning: Helps you reason about StarRocks’ column batch processing and pipeline model to select better parallelism (pipeline DOP) and reduce operator overhead.
  • Runtime filters, predicate pushdown, and partition pruning: Diagnoses why scans aren’t skipping data (e.g., RF missing or not applied, predicates not pushed down, partitions/tablets not pruned).
  • CBO statistics and optimizer control: Guides collecting/updating CBO stats (ANALYZE TABLE, histograms, auto-analyze) and using session variables or hints to override suboptimal optimizer decisions (join strategy, join order, caching behavior).

Quick Start

Load this skill and tell the user to run EXPLAIN VERBOSE for their StarRocks SQL to identify missing runtime filters, lack of partition pruning, and suboptimal join strategy.

Frequently Asked Questions about starrocks-query-optimizer

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

FAQPage Schema
How do I fix slow StarRocks queries caused by missing runtime filters or bad join strategy?

Diagnose slow StarRocks queries by running EXPLAIN VERBOSE to inspect execution plans for missing runtime filters, absent predicate pushdown, or suboptimal join strategy, then apply targeted hints and session variables to force better plans.

Why does StarRocks scan the entire table instead of pruning partitions during my query?

StarRocks fails to prune partitions when predicates are not pushed down to the scan level or CBO statistics are missing. Run ANALYZE TABLE to update stats and ensure filter conditions align with partition columns for proper tablet pruning.

How do I collect CBO statistics in StarRocks to improve the execution plan?

Collect CBO statistics in StarRocks by running ANALYZE TABLE workflows, including histograms and auto-analyze, to provide the optimizer with accurate data distribution. This ensures better join order selection and more efficient vectorized pipeline execution.

What is the best way to tune pipeline parallelism and vectorized execution in StarRocks?

Tune StarRocks pipeline parallelism by adjusting pipeline DOP session variables to optimize column batch processing and reduce operator overhead. This vectorized execution model ensures better resource utilization during production BI and batch ETL workloads.

Can I override the StarRocks optimizer when it chooses a suboptimal join order?

You can override the StarRocks optimizer by setting session variables or adding SQL hints to force a specific join strategy and join order. This corrects suboptimal execution plans when CBO statistics are outdated or insufficient for accurate cost estimation.

Why are my StarRocks runtime filters not being applied to the join probe side?

StarRocks runtime filters may not apply if the RF bloom, IN, or MIN-MAX mechanics are incompatible with the join strategy or if the probe side waits too long. Diagnose EXPLAIN PROFILE discrepancies to identify sync barriers and missing filter generation.