# Multi-table insert from staging to raw on Snowflake

**URL:** <https://forum.data-community.org/t/multi-table-insert-from-staging-to-raw-on-snowflake/1700>\
**Category:** Data Vault 2.0\
**Created:** [February 2, 2025, 10:07pm UTC](https://forum.data-community.org/t/multi-table-insert-from-staging-to-raw-on-snowflake/1700 "2025-02-02T22:07:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhall\_uk](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.data-community.org/jhall_uk/32/79_2.png) [@jhall\_uk](https://forum.data-community.org/u/jhall_uk)\
**Post date:** [February 2, 2025, 10:07pm UTC](https://forum.data-community.org/t/multi-table-insert-from-staging-to-raw-on-snowflake/1700/1 "2025-02-02T22:07:45Z")

</div>

Hello everyone!  
I’ve seen a number of sample articles relating to near-real time integration on a Snowflake platform. One article advocates using a combo of staging tables, staging metadata views and streams as a basis to load a target raw vault hub/link/sat table using a multi-table insert embedded within a single task.

example:  
[https://quickstarts.snowflake.com/guide/vhol\_data\_vault/index.html?index=..%2F..index#0](https://quickstarts.snowflake.com/guide/vhol_data_vault/index.html?index=..%2F..index#0)

My question is whether having a single task to do this is prudent or whether creating separate loader tasks for each target hub/link/sat is better. Given that multiple tasks will likely consume more compute than a single one, on a consumption-based platform such as Snowflake it is an important consideration, but not one that trumps potential data duplicates or other issues in the target tables.

I’m trying to get my head around @patrickcuba 's article on MTIs here:

> **[Data Vault on Snowflake: Conditional Multi-Table INSERT, and where to use it](https://patrickcuba.medium.com/data-vault-on-snowflake-conditional-multi-table-insert-and-where-to-use-it-2f247a79d38d)**
>
> Snowflake continues to set the standard for Data in the Cloud by taking away the need to perform maintenance tasks on your data platform…

…which suggests being careful about using MTIs. Is this only an issue where you may have multiple when clauses hitting the same target hub? What about if you have multiple staged tables that may be the source of a business key with their own hub loader?

Should I essentially ignore the Snowflake quickstart guide on this specific matter of getting data from staging into hubs/links/sats in parallel?

---

<div class="post-metadata">

**Author:** ![patrickcuba](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.data-community.org/patrickcuba/32/19_2.png) [@patrickcuba](https://forum.data-community.org/u/patrickcuba)\
**Post date:** [February 2, 2025, 10:25pm UTC](https://forum.data-community.org/t/multi-table-insert-from-staging-to-raw-on-snowflake/1700/2 "2025-02-02T22:25:57Z")

</div>

Using MTI for DV is dangerous, see here: [Data Vault Loader Traps. You might have already had to deal with… | by Patrick Cuba | Medium](https://patrickcuba.medium.com/data-vault-loader-traps-af304b9c8bf8)

The article pretty much dispels many of the techniques that quick start advocates for, it was published BEFORE I joined Snowflake.

---

<div class="post-metadata">

**Author:** ![jhall\_uk](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.data-community.org/jhall_uk/32/79_2.png) [@jhall\_uk](https://forum.data-community.org/u/jhall_uk)\
**Post date:** [February 4, 2025, 8:34pm UTC](https://forum.data-community.org/t/multi-table-insert-from-staging-to-raw-on-snowflake/1700/3 "2025-02-04T20:34:12Z")

</div>

Thanks Patrick - separate loaders it is for the raw vault load.

Is there anything else relating to the staging table that is problematic on Snowflake? Is leveraging a view (containing the DV metadata) on top of the staging table’s Stream object ok? Or is it better to persist the DV metadata within the staging table as separate loaders for hub, links sats would need to compute hashkeys etc each time the view is executed per loader.

---

<div class="post-metadata">

**Author:** ![patrickcuba](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.data-community.org/patrickcuba/32/19_2.png) [@patrickcuba](https://forum.data-community.org/u/patrickcuba)\
**Post date:** [February 4, 2025, 11:00pm UTC](https://forum.data-community.org/t/multi-table-insert-from-staging-to-raw-on-snowflake/1700/4 "2025-02-04T23:00:28Z")

</div>

Streams on Views - do that instead. [Introduction to Streams | Snowflake Documentation](https://docs.snowflake.com/en/user-guide/streams-intro#streams-on-views)

And yes, that’s a framework I have promoted here: [Data Vault on Snowflake: Streams & Tasks on Views | by Patrick Cuba | Medium](https://patrickcuba.medium.com/data-vault-on-snowflake-streams-tasks-on-views-7ce5a70e9963)

And here: [Kappa Vault. This article expands on “Data Vault… | by Patrick Cuba | Medium](https://patrickcuba.medium.com/kappa-vault-bc7908a51ea3)
