Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging relational cache events #6429

Merged
merged 3 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>

Check warning on line 1 in website/snippets/_log-relational-cache.md

View workflow job for this annotation

GitHub Actions / vale

[vale] website/snippets/_log-relational-cache.md#L1

[custom.Typos] Oops there's a typo -- did you really mean '`LOG_CACHE_EVENTS`'?
Raw output
{"message": "[custom.Typos] Oops there's a typo -- did you really mean '`LOG_CACHE_EVENTS`'? ", "location": {"path": "website/snippets/_log-relational-cache.md", "range": {"start": {"line": 1, "column": 8}}}, "severity": "WARNING"}

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