Skip to content

Commit

Permalink
Logging relational cache events (#6429)
Browse files Browse the repository at this point in the history
  • Loading branch information
mirnawong1 authored Nov 7, 2024
2 parents 4a31dfc + 6afb6ac commit 7518352
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
10 changes: 9 additions & 1 deletion website/docs/reference/global-configs/cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sidebar: "Cache"

### Cache population

At the start of runs, dbt caches metadata about all the objects in all the schemas where it might materialize resources (such as models). By default, dbt populates the cache with information on all schemas related to the project.
At the start of runs, dbt caches metadata about all the objects in all the schemas where it might materialize resources (such as models). By default, dbt populates the relational cache with information on all schemas related to the project.

There are two ways to optionally modify this behavior:
- `POPULATE_CACHE` (default: `True`): Whether to populate the cache at all. To skip cache population entirely, use the `--no-populate-cache` flag or `DBT_POPULATE_CACHE: False`. Note that this does not _disable_ the cache; missed cache lookups will run queries, and update the cache afterward.
Expand All @@ -26,3 +26,11 @@ Or, to improve speed and performance while focused on developing Salesforce mode
dbt --cache-selected-only run --select salesforce
```

### Logging relational cache events

import LogLevel from '/snippets/_log-relational-cache.md';

<LogLevel
event="relational cache"
/>
8 changes: 4 additions & 4 deletions website/docs/reference/global-configs/logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@ You can use either of these parameters to ensure clean output that's compatible

### Logging relational cache events

The `LOG_CACHE_EVENTS` config allows detailed logging for [relational cache](/reference/global-configs/cache) events, which are disabled by default.
import LogLevel from '/snippets/_log-relational-cache.md';

```text
dbt --log-cache-events compile
```
<LogLevel
event={<a href="https://docs.getdbt.com/reference/global-configs/cache">relational cache</a>}
/>

### Color

Expand Down
5 changes: 5 additions & 0 deletions website/snippets/_log-relational-cache.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<p>The `LOG_CACHE_EVENTS` config allows detailed logging for {props.event}, which are disabled by default.</p>

```text
dbt --log-cache-events compile
```

0 comments on commit 7518352

Please sign in to comment.