1. Merge Strategy (Recommended)
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
| Strategy | Best For | How It Works |
|---|---|---|
| Merge | Updating existing rows + inserting new | Matches on unique_key, updates existing, inserts new |
| Delete+Insert | Recomputing partitions | Deletes matching rows, then inserts new data |
| Append | Immutable event logs | Only inserts new rows, no updates or deletes |
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: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: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