Trino Query Optimizer
Analyze and optimize Trino queries. Reads EXPLAIN plans, predicts CPU, memory, and scan cost before running, rewrites expensive federated queries, and surfaces partition-pruning and join-order fixes for faster, cheaper distributed SQL.
This skill optimizes Trino (formerly PrestoSQL) queries: reading and interpreting EXPLAIN and EXPLAIN ANALYZE plans, predicting CPU, memory, and bytes-scanned cost before execution, rewriting expensive federated queries across connectors, and recommending partition pruning, join reordering, and dynamic filtering to make distributed SQL faster and cheaper.
When to use
Use when a Trino query is slow or expensive, when reading a Trino query plan, estimating query cost before running, or optimizing federated queries across connectors.
Examples
Explain the cost
Why is it expensive
Explain why this Trino query is so expensive from its EXPLAIN ANALYZE plan and estimate its CPU and scan cost
Optimize a slow join
Rewrite for speed
Rewrite this Trino query with better join order and partition pruning so it scans less data and finishes faster
Predict before running
Cost estimate
Estimate the cost of this Trino query against a large partitioned table before I run it, and flag if it needs a date filter