starrocks-join-optimization

Diagnose and optimize StarRocks equi-join strategies using EXPLAIN output.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you diagnose and fix slow or resource-heavy join queries in StarRocks by choosing the most efficient join strategy and verifying it from EXPLAIN output.

Core Features & Use Cases

  • Join strategy selection: Covers broadcast, shuffle (hash partition), colocate, bucket shuffle, and nested loop (for non-equi and cross joins), plus the optimizer decision flow and how hints can override it.
  • Runtime filter impact: Explains how runtime filters (Bloom/IN/MIN_MAX) reduce probe-side scan work and how to confirm their pushdown using EXPLAIN VERBOSE.
  • Skew join handling: Detects join skew symptoms in query profiles and provides a practical salting approach to prevent uneven BE workloads.
  • EXPLAIN-based verification: Shows what to look for in plan fragments (e.g., BROADCAST/COLOCATE/PARTITIONED/BUCKET_SHUFFLE/NESTLOOP and Exchange placement) to ensure the intended strategy actually executed.
  • Practical guardrails: Includes guardrail guidance for stale statistics (ANALYZE), broadcast memory risk (broadcast_row_limit), and colocate group stability requirements (SHOW PROC '/colocation_group').

Quick Start

Use StarRocks EXPLAIN VERBOSE on your slow join query to identify the chosen join strategy (e.g., BROADCAST/COLOCATE/PARTITIONED) and the presence of pushed-down runtime filters, then apply the corresponding hint or design change.

Frequently Asked Questions about starrocks-join-optimization

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

FAQPage Schema
How do I fix slow StarRocks join queries using EXPLAIN output?

To fix slow StarRocks join queries, run EXPLAIN VERBOSE to identify the executed join strategy (BROADCAST/COLOCATE/PARTITIONED/BUCKET_SHUFFLE/NESTLOOP) and Exchange placement. Then apply optimizer hints or design changes to select the most efficient join strategy and validate that runtime filters are pushed down to reduce probe-side scans.

What is the best join strategy to prevent data skew in StarRocks?

To prevent data skew in StarRocks, detect skew symptoms in query profiles and apply a practical salting approach to distribute workloads evenly across Backends (BEs). Selecting appropriate partitioned or bucket-shuffle join strategies mitigates uneven processing during execution.

How do runtime filters improve StarRocks join performance?

Runtime filters (Bloom/IN/MIN_MAX) improve StarRocks join performance by reducing probe-side scan work. Verify their pushdown effectiveness by checking EXPLAIN VERBOSE output to ensure filters are actively applied before the join operation executes.

When should I use colocate join in StarRocks and what are the requirements?

Use colocate join in StarRocks when joining tables with matching bucketing distributions to eliminate network shuffle. Ensure colocate group stability by verifying SHOW PROC '/colocation_group' and maintaining consistent bucket definitions across participating tables.

Why does my StarRocks broadcast join cause memory failures?

StarRocks broadcast joins cause memory failures when the right-side table exceeds safe broadcast_row_limit thresholds. Run ANALYZE to update stale statistics so the optimizer accurately evaluates table sizes, or switch to a shuffle partition strategy to distribute data across nodes.

Can I use StarRocks for non-equi joins and cross joins without performance regression?

StarRocks supports non-equi and cross joins using the nested loop strategy. Verify NESTLOOP execution via EXPLAIN output to ensure no unintended regressions occur, and apply appropriate session variables or hints to optimize execution for these specific join types.