# Split single run of \`dbt materialize\` by temporal field and commit them separately

**URL:** <https://discourse.getdbt.com/t/split-single-run-of-dbt-materialize-by-temporal-field-and-commit-them-separately/12614>\
**Category:** Help\
**Tags:** incremental, materialization, postgres\
**Created:** [March 25, 2024, 4:38am UTC](https://discourse.getdbt.com/t/split-single-run-of-dbt-materialize-by-temporal-field-and-commit-them-separately/12614 "2024-03-25T04:38:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sazary](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/sazary/32/3824_2.png) [@sazary](https://discourse.getdbt.com/u/sazary)\
**Post date:** [March 25, 2024, 4:38am UTC](https://discourse.getdbt.com/t/split-single-run-of-dbt-materialize-by-temporal-field-and-commit-them-separately/12614/1 "2024-03-25T04:38:40Z")

</div>

i’m using `dbt` to materialize a table on a `postgresql`. this table has a temporal field (`timestamp`).

the problem is that when this table is being created for the first time `dbt` runs all of it using a single sql query (as defined in my model) and it gets timed out as it exceeds `statement_timeout`, and no data is inserted in the table even as a lot of proccessing has been done.

is there any solution which breaks up the data into several steps and commits each step as it gets completed? this way the `dbt run` would still take a long time but each step is a separate query and it wouldn’t surpass `statement_timeout`

i know about the `incremental` option of `dbt` and i use it in next runs, but my problem is about the initial run.

thanks

---

<div class="post-metadata">

**Author:** ![jeffsk](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/jeffsk/32/1250_2.png) [@jeffsk](https://discourse.getdbt.com/u/jeffsk)\
**Post date:** [April 8, 2024, 12:18pm UTC](https://discourse.getdbt.com/t/split-single-run-of-dbt-materialize-by-temporal-field-and-commit-them-separately/12614/2 "2024-04-08T12:18:30Z")

</div>

You would have to create a custom materialization if you want to insert in batches. Or increase your query time out.
