Skip to content

Commit 6c4bbb0

Browse files
Fix em-dashes and expand pre-aggregates section
Generated-By: mintlify-agent
1 parent 971cd55 commit 6c4bbb0

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

guides/developer/dbt-model-best-practices.mdx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ When building your dbt models for Lightdash, following these best practices will
1010

1111
When deciding between wide materialized tables and smaller normalized tables that require multiple joins, you're balancing trade-offs across three dimensions: **performance**, **self-serve usability**, and **analytical depth**.
1212

13-
There's no one-size-fits-all answer—the right approach depends on your team's needs and how you want to empower your users.
13+
There's no one-size-fits-all answer. The right approach depends on your team's needs and how you want to empower your users.
1414

1515
### Wide tables vs. multi-join models
1616

1717
| Factor | Wide tables | Multi-join models |
1818
|--------|-------------|-------------------|
19-
| **Performance** | Generally fastermaterialized at the grain you need for specific analyses | Joins computed at query time; mitigated by fanout protection |
20-
| **Self-serve usability** | Easier for business usersall fields in one place, less overwhelming | Can be intimidating10 joined tables on one page is a lot for most users |
19+
| **Performance** | Generally faster since they're materialized at the grain you need for specific analyses | Joins computed at query time, though mitigated by fanout protection |
20+
| **Self-serve usability** | Easier for business users with all fields in one place, less overwhelming | Can be intimidating since 10 joined tables on one page is a lot for most users |
2121
| **Analytical depth** | May require multiple wide tables for different use cases | More flexible for complex analyses across multiple dimensions |
2222

2323
### When wide tables work best
@@ -37,7 +37,7 @@ Modern columnar data warehouses (like Snowflake, BigQuery, and Redshift) are opt
3737

3838
Some analyses genuinely require multiple joins. For example, analyzing Bookings while filtering by an upstream dimension (like organic SEO traffic source) and breaking down by a downstream dimension (like a specific location) will likely require joins to be correct.
3939

40-
Lightdash handles multi-join explores well technically[fanout protection](/references/joins#many-to-many-or-one-to-many-with-fanout-protection) ensures accuracy. However, looking at a page with many joined tables can be overwhelming for business users who aren't familiar with the data model.
40+
Lightdash handles multi-join explores well technically, and [fanout protection](/references/joins#many-to-many-or-one-to-many-with-fanout-protection) ensures accuracy. However, looking at a page with many joined tables can be overwhelming for business users who aren't familiar with the data model.
4141

4242
### Common approaches
4343

@@ -161,7 +161,11 @@ Pre-aggregates are especially useful for:
161161
- Commonly used metric combinations
162162
- Time-series data at standard intervals (daily, weekly, monthly)
163163

164-
The trade-off is maintenance overhead—you need to keep pre-aggregates in sync with your source data and ensure users understand when to use them vs. the detailed tables.
164+
You can implement pre-aggregates in two ways:
165+
- **In Lightdash**: Use [Lightdash pre-aggregates](/references/pre-aggregates) to automatically cache aggregated results
166+
- **In dbt or your warehouse**: Pre-join and materialize tables directly as dbt models or warehouse tables if you prefer to manage them outside of Lightdash
167+
168+
The trade-off is maintenance overhead. You need to keep pre-aggregates in sync with your source data and ensure users understand when to use them vs. the detailed tables.
165169

166170
### Leverage caching
167171

0 commit comments

Comments
 (0)