trino-explain-plan-review

Diagnose Trino query bottlenecks by analyzing EXPLAIN ANALYZE distributed plans.

14|1|Updated May 5, 2026
One-click install
npx skills add https://github.com/ivanshamaev/de-agent-skills --skill trino-explain-plan-review
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: trino-explain-plan-review
Source: https://github.com/ivanshamaev/de-agent-skills/tree/main/group_skills/trino_group_skills/trino_explain_plan_review
Command: npx skills add https://github.com/ivanshamaev/de-agent-skills --skill trino-explain-plan-review

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you pinpoint why a Trino query is slow by interpreting EXPLAIN and EXPLAIN ANALYZE output, including distributed fragments, exchanges, skew, and operator-level bottlenecks.

Core Features & Use Cases

  • Plan-type driven diagnosis: Read DISTRIBUTED, LOGICAL, IO, and VALIDATE views to confirm what the engine decided to do.
  • Exchange and fragment analysis: Identify RemoteExchange patterns and fragment types (SINGLE/HASH/ROUND_ROBIN/BROADCAST/SOURCE) to reduce shuffle and network cost.
  • Runtime metric interpretation: Detect skew using input row variance, spot spill and blocked-time issues, and compare estimated vs actual rows to catch stale stats and misplanning.
  • Common slow-plan anti-patterns: Find missing partition pruning, predicate pushdown failures, cross joins, accidental extra repartitioning, and small-file split explosions.

Quick Start

Ask the agent to run EXPLAIN ANALYZE for your query and review the distributed fragments, RemoteExchange count, skew signals (input avg vs std.dev), and estimated-versus-actual row disparities to recommend the most likely fix.

Frequently Asked Questions about trino-explain-plan-review

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

FAQPage Schema
How do I diagnose slow Trino queries from EXPLAIN ANALYZE plans?

Diagnose slow Trino queries by running EXPLAIN ANALYZE to inspect distributed fragments, RemoteExchange count, and operator-level runtime metrics like input row variance and blocked time to identify bottlenecks.

Why does my Trino query have high network cost and remote exchanges?

High network cost in Trino stems from unnecessary RemoteExchange shuffles caused by accidental repartitioning or improper fragment types like SINGLE or HASH, requiring analysis of distributed plan fragments to minimize shuffle overhead.

How do I check if predicate pushdown and partition pruning work in Trino?

Check predicate pushdown and partition pruning in Trino by reviewing the IO and DISTRIBUTED plan views to confirm table access constraints and ensure missing partition pruning anti-patterns are absent.

How do I detect data skew and spill issues in Trino query plans?

Detect data skew and spill issues in Trino by interpreting runtime metrics from EXPLAIN ANALYZE, comparing input average versus standard deviation to spot row variance and checking for blocked-time signals.

What causes estimated versus actual row count discrepancies in Trino plans?

Estimated versus actual row count discrepancies in Trino plans are caused by stale statistics and misplanning, which you can catch by comparing planned estimates against observed runtime operator metrics in EXPLAIN ANALYZE output.

What are common slow-plan anti-patterns when tuning Trino query performance?

Common slow-plan anti-patterns in Trino include missing partition pruning, predicate pushdown failures, cross joins, accidental extra repartitioning, and small-file split explosions that inflate scan overhead.