# When insert in parent table?

**URL:** <https://forum.data-community.org/t/when-insert-in-parent-table/328>\
**Category:** Data Vault 2.0\
**Created:** [June 15, 2022, 1:43pm UTC](https://forum.data-community.org/t/when-insert-in-parent-table/328 "2022-06-15T13:43:00Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arthur](https://avatars.discourse-cdn.com/v4/letter/a/958977/32.png) [@Arthur](https://forum.data-community.org/u/Arthur)\
**Post date:** [June 15, 2022, 1:43pm UTC](https://forum.data-community.org/t/when-insert-in-parent-table/328/1 "2022-06-15T13:43:01Z")

</div>

Hello,

We can read concerning link loading in The Data Vault Guru that:

> Has the staged source file of the link table been used to supply content to parent hub tables?  
> Yes

Should we understand that when a link is inserted we also have to insert (if not already present) all related hubs?  
More generally, should we always insert in parent table (hub or link) when we insert in a child table (link or satellite)?

Thanks

---

<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:** [June 15, 2022, 4:16pm UTC](https://forum.data-community.org/t/when-insert-in-parent-table/328/2 "2022-06-15T16:16:18Z")

</div>

Hello

To keep architecture implementations simple you should have landing, staging, loading

DV loading comes from what was staged  
If a landed file contains a relationship between business objects then you will use

- a link loader and
- 

> =2 hub loaders

Hubs are parent tables of a link or satellite

---

<div class="post-metadata">

**Author:** ![FrenkLoonen](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.data-community.org/frenkloonen/32/119_2.png) [@FrenkLoonen](https://forum.data-community.org/u/FrenkLoonen)\
**Post date:** [June 16, 2022, 7:31am UTC](https://forum.data-community.org/t/when-insert-in-parent-table/328/3 "2022-06-16T07:31:53Z")

</div>

I was wondering the same myself.

What if you have a database source that enforces referential integrity, from which you do a direct pull?  
I have table Customer\_Core with CustomerID which gets loaded to Hub\_Customer and Sat\_Customer\_Core.

Then I have table Customer\_Additional with CustomerID which gets loaded to Sat\_Customer\_Additional. CustomerID in this table cannot exist if it is not in Customer\_Core. Should I still load Hub\_Customer from this table?

I would say yes. Load from all possible occurrences in all sources. You’ll get a hit on performance but since you’re loading a hub which will probably never be that big, the performance hit isn’t significant.

---

<div class="post-metadata">

**Author:** ![Arthur](https://avatars.discourse-cdn.com/v4/letter/a/958977/32.png) [@Arthur](https://forum.data-community.org/u/Arthur)\
**Post date:** [June 16, 2022, 9:08am UTC](https://forum.data-community.org/t/when-insert-in-parent-table/328/4 "2022-06-16T09:08:38Z")

</div>

Hello,  
Thanks for the reply.  
The special case I was thinking about is when we load link and we only have the BK of a referenced hub in the staged table.  
I note that we always insert in parent table even if there is no descriptive data to add in a satellite.

---

<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:** [June 16, 2022, 3:04pm UTC](https://forum.data-community.org/t/when-insert-in-parent-table/328/5 "2022-06-16T15:04:27Z")

</div>

What performance hit?

Hub, link and Sat loaders are autonomous tasks running in parallel against very thin tables.

---

<div class="post-metadata">

**Author:** ![FrenkLoonen](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.data-community.org/frenkloonen/32/119_2.png) [@FrenkLoonen](https://forum.data-community.org/u/FrenkLoonen)\
**Post date:** [June 16, 2022, 3:18pm UTC](https://forum.data-community.org/t/when-insert-in-parent-table/328/6 "2022-06-16T15:18:17Z")

</div>

Having to do a

SELECT BK  
FROM src\_table\_1

as opposed to doing a

SELECT BK  
FROM src\_table\_1  
UNION  
SELECT BK  
FROM src\_table\_2  
UNION  
SELECT BK  
FROM src\_table\_3  
etc

---

<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:** [June 16, 2022, 3:40pm UTC](https://forum.data-community.org/t/when-insert-in-parent-table/328/7 "2022-06-16T15:40:19Z")

</div>

That is a dbt limitation, not a DV limitation

---

<div class="post-metadata">

**Author:** ![FrenkLoonen](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.data-community.org/frenkloonen/32/119_2.png) [@FrenkLoonen](https://forum.data-community.org/u/FrenkLoonen)\
**Post date:** [June 16, 2022, 4:26pm UTC](https://forum.data-community.org/t/when-insert-in-parent-table/328/8 "2022-06-16T16:26:03Z")

</div>

Well it’s not a dbtvault limitation actually, they support the multi-source hub pattern. So no problems there. It’s just that the select with the unions will be slower, hence the performance hit I was referring to.

---

<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:** [June 16, 2022, 4:38pm UTC](https://forum.data-community.org/t/when-insert-in-parent-table/328/9 "2022-06-16T16:38:11Z")

</div>

It is a dbt limitation

Dbt doesn’t allow for multiple sql files to load to the same model, one file one model hence why dbtvault resorted to creating a Union all

Ideal DV automation is to have single purpose hub loaders, 1-1 src to tgt, so you don’t read srcs you don’t need when loading a hub.

---

<div class="post-metadata">

**Author:** ![FrenkLoonen](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.data-community.org/frenkloonen/32/119_2.png) [@FrenkLoonen](https://forum.data-community.org/u/FrenkLoonen)\
**Post date:** [June 16, 2022, 4:50pm UTC](https://forum.data-community.org/t/when-insert-in-parent-table/328/10 "2022-06-16T16:50:18Z")

</div>

Ah right, yes, sorry for missing that point

And I guess the single purpose hub loaders you mention is in reference to what you describe [HERE](https://www.linkedin.com/pulse/data-vault-agility-snowflake-patrick-cuba/) related to Snowflake?

---

<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:** [June 16, 2022, 4:53pm UTC](https://forum.data-community.org/t/when-insert-in-parent-table/328/11 "2022-06-16T16:53:07Z")

</div>

Absolutely,  
Autonomous, independent, micro service style architecture that makes it easy to recover from failure - follows the Unix mantra

---

<div class="post-metadata">

**Author:** ![RhysHanscombe](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.data-community.org/rhyshanscombe/32/394_2.png) [@RhysHanscombe](https://forum.data-community.org/u/RhysHanscombe)\
**Post date:** [December 1, 2025, 2:29pm UTC](https://forum.data-community.org/t/when-insert-in-parent-table/328/12 "2025-12-01T14:29:23Z")

</div>


