trino-query-cost-analyzer

Analyze Trino query plans and historical data to predict CPU time, memory usage, and data scanned.

31|4|Updated Aug 24, 2021
One-click install
npx skills add https://github.com/razorpay/trino-gateway --skill trino-query-cost-analyzer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: trino-query-cost-analyzer
Source: https://github.com/razorpay/trino-gateway/tree/main/.agents/skills/trino-analyzer
Command: npx skills add https://github.com/razorpay/trino-gateway --skill trino-query-cost-analyzer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires trino, and includes scripts (resource) and references (resource) components.

What problem does it solve?

Analyze Trino query costs by examining query plans, CPU/memory usage, and historical data to predict costs, identify expensive queries, and guide cost-saving optimizations in Trino deployments.

Core Features & Use Cases

  • Predict query cost before execution to avoid expensive runs.
  • Analyze expensive queries and suggest concrete optimizations to reduce resource usage.
  • Understand query execution plans and extract actionable insights from EXPLAIN outputs.
  • Compare predicted costs with historical data to validate improvements and track trends.

Quick Start

Provide a SQL query or file to Claude and request a cost prediction with notes on optimization options.

Frequently Asked Questions about trino-query-cost-analyzer

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

FAQPage Schema
How do I predict Trino query costs before execution?

Trino query cost analysis combines plan evaluation with historical data to estimate CPU time, memory usage, and data scanned. It identifies expensive queries and provides optimization recommendations to reduce resource consumption.

How do I analyze and optimize expensive Trino queries?

Analyzing expensive Trino queries involves extracting actionable insights from EXPLAIN outputs and historical showback data to identify resource bottlenecks and recommend concrete optimizations for reducing CPU and memory usage.

What is the best way to compare predicted and historical Trino query costs?

Comparing predicted and historical Trino query costs involves reading from delta.dbt_prod_de_metrics.trino_showback to validate cost predictions against actual execution data, enabling trend tracking and improvement validation across clusters.

Do I need a specific Trino setup to analyze query plans?

To use Trino query cost analysis, you need a Trino deployment with access to EXPLAIN outputs and the delta.dbt_prod_de_metrics.trino_showback dataset for historical cost data.

How do I extract actionable insights from Trino EXPLAIN outputs?

Extracting insights from Trino EXPLAIN outputs involves analyzing query plan features to understand execution patterns and identify optimization opportunities for reducing resource consumption.