trino-dbt-query-performance

Optimize dbt-generated SQL performance on Trino with materializations and incremental strategies.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you reduce slow dbt-generated queries on Trino by improving dbt materialization choices, incremental filtering, and Trino execution characteristics.

Core Features & Use Cases

  • Materialization strategy optimization: Selects between view, ephemeral, table, incremental, and materialized_view based on cost and freshness needs.
  • Incremental performance safeguards: Designs bounded, partition-aware is_incremental() filters to prevent accidental full scans.
  • Efficient incremental write strategies on Iceberg: Chooses MERGE vs delete+insert and introduces patterns to avoid small-file proliferation.
  • Trino cost controls for dbt: Recommends session properties, thread tuning, join hints (e.g., BROADCAST), and targeted post-run ANALYZE for better CBO planning.
  • Safety against production regressions: Shows how to prevent risky full-refresh usage on large tables and calls out common anti-patterns.

Quick Start

Configure your dbt Trino profiles and rewrite your incremental models using bounded watermarks and the right incremental strategy to stop full scans and reduce runtime.

Frequently Asked Questions about trino-dbt-query-performance

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

FAQPage Schema
Why does my dbt incremental model still scan the full table on Trino?

Your dbt incremental model scans the full table on Trino when it lacks bounded, partition-aware is_incremental() filters. You must design watermarks and partition-aware filtering to prevent accidental full scans and reduce query runtime.

How do I stop small file proliferation in Iceberg when writing dbt models?

To stop small file proliferation in Iceberg during dbt writes, choose the right incremental write strategy by selecting between MERGE and delete+insert patterns. This approach avoids heavy writes and prevents small-file growth.

What is the best way to tune Trino session properties for slow dbt runs?

The best way to tune Trino session properties for slow dbt runs is configuring thread settings, applying join hints like BROADCAST, and running targeted post-run ANALYZE commands to improve cost-based optimization planning.

When should I use materialized views instead of incremental models in dbt?

You should use materialized views instead of incremental models in dbt based on specific cost and freshness needs. Selecting between view, ephemeral, table, incremental, and materialized_view materializations directly balances query expense against data update frequency.

How do I prevent risky full-refresh dbt runs on large Trino tables?

To prevent risky full-refresh dbt runs on large Trino tables, implement safety safeguards against production regressions. This involves calling out common anti-patterns and blocking full-refresh usage to protect massive datasets from expensive recomputation.