Skip to main content
dbt supports multiple strategies for incremental models. The template includes examples of each strategy to help you get started. When to use: When you need to update existing rows and insert new ones. Example:

2. Delete+Insert Strategy

When to use: When recomputing entire partitions (e.g., daily aggregations). Example:

3. Append Strategy

When to use: For immutable event logs that only need new rows appended. Example:

Strategy Comparison

Table Maintenance

Maintenance operations consume credits based on compute and data written. These operations are necessary to keep your tables performant and to reclaim storage space.

Manual Maintenance

Run OPTIMIZE and VACUUM to improve performance and reduce storage costs:

Automated Maintenance with dbt post-hooks

Add post-hooks to your model configuration:

Project level post-hooks

Add post-hooks to your project configuration:
The template repository includes a default post-hook that runs OPTIMIZE and VACUUM on all tables.

Dropping Tables

dbt doesn’t have a built-in way to drop tables. Options:

Option 1: Use dbt’s —full-refresh flag then remove the model

Option 2: Connect with a SQL client

Use any Trino-compatible client (Hex, Jupyter, DBeaver) to execute:
See the SQL Operations Reference for details.

Examples

Complete examples are available in the template repository:
  • View Model: Lightweight, always fresh data
  • Table Model: Static snapshots for specific points in time
  • Merge Incremental: Update existing rows, insert new ones
  • Delete+Insert Incremental: Recompute partitions efficiently
  • Append Incremental: Add-only with deduplication

dbt Template Repository

See all example models in our official dbt template repository