# DBT run model only once

**URL:** <https://discourse.getdbt.com/t/dbt-run-model-only-once/17640>\
**Category:** Help\
**Created:** [January 6, 2025, 6:50pm UTC](https://discourse.getdbt.com/t/dbt-run-model-only-once/17640 "2025-01-06T18:50:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pablote16](https://avatars.discourse-cdn.com/v4/letter/p/7cd45c/32.png) [@pablote16](https://discourse.getdbt.com/u/pablote16)\
**Post date:** [January 6, 2025, 6:50pm UTC](https://discourse.getdbt.com/t/dbt-run-model-only-once/17640/1 "2025-01-06T18:50:58Z")

</div>

Hi, I have some models created as:

Select “XX”  
UNION  
Select “YY”

They basically works as config tables. I only want to run these models once, since I dont need to update them once they are created. How could I achieve this? Is there any config to incremental tables I should apply?

PD: option B would be to use seeds.

---

<div class="post-metadata">

**Author:** ![a\_slack\_user](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/a_slack_user/32/1629_2.png) [@a\_slack\_user](https://discourse.getdbt.com/u/a_slack_user)\
**Post date:** [January 6, 2025, 7:31pm UTC](https://discourse.getdbt.com/t/dbt-run-model-only-once/17640/2 "2025-01-06T19:31:05Z")

</div>

First off, if you don’t actually need to access any of the data stored in this config outside of dbt, you could use project variables or even an ephemeral model. I’m guessing it is a requirement to see this config in the database outside of dbt though but thought I’d mention them anyhow. When it comes to making a static table though I use an incremental model with an append strategy with an `if is_incremental()` block that simply does a `select * where false` . Note that the model will still re-run and re-create the table when `--full-refresh` is specified but I use this as a way to actually refresh the table if there have been changes made to it. If you don’t want even a full refresh to change it, you can add a model config `+full_refresh: false` that will stop it from ever being re-written and in that case you would have to drop the table manually for dbt to recreate it.

Note: `@Mark Estey` originally [posted this reply in Slack](https://getdbt.slack.com/archives/CBSQTAPLG/p1736191847278309?thread_ts=1736189480.382769&cid=CBSQTAPLG). It might not have transferred perfectly.

---

<div class="post-metadata">

**Author:** ![marcelo](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/marcelo/32/6126_2.png) [@marcelo](https://discourse.getdbt.com/u/marcelo)\
**Post date:** [January 6, 2025, 7:55pm UTC](https://discourse.getdbt.com/t/dbt-run-model-only-once/17640/3 "2025-01-06T19:55:27Z")

</div>

Hi @pablote16 !

An alternative could be to:

1. Materialize them as [tables](https://docs.getdbt.com/docs/build/materializations#table).
2. After a build, [exclude](https://docs.getdbt.com/reference/node-selection/exclude) them from running using [node selection methods](https://docs.getdbt.com/reference/node-selection/methods). One of the simplest ways is to put those models in a folder and filter them by [path](https://docs.getdbt.com/reference/node-selection/methods#path). Another alternative if they are more scattered is to create a [tag](https://docs.getdbt.com/reference/node-selection/methods#tag) and exclude it from all jobs.

Let me know if you find it useful and if you need further clarification.

---

<div class="post-metadata">

**Author:** ![pablote16](https://avatars.discourse-cdn.com/v4/letter/p/7cd45c/32.png) [@pablote16](https://discourse.getdbt.com/u/pablote16)\
**Post date:** [January 7, 2025, 2:00am UTC](https://discourse.getdbt.com/t/dbt-run-model-only-once/17640/4 "2025-01-07T02:00:14Z")

</div>

But in that case, dbt still runs the query before checking the **if is\_incremental** right? Is not that unperformant? In this case we are talking about simple logic tables but what about more complex models?

Super clear about the rest, thanks!
