# How join works with two different data sources

**URL:** <https://community.dremio.com/t/how-join-works-with-two-different-data-sources/4411>\
**Category:** Uncategorized\
**Created:** [October 24, 2019, 5:31am UTC](https://community.dremio.com/t/how-join-works-with-two-different-data-sources/4411 "2019-10-24T05:31:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![madhusudhan](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@madhusudhan](https://community.dremio.com/u/madhusudhan)\
**Post date:** [October 24, 2019, 5:31am UTC](https://community.dremio.com/t/how-join-works-with-two-different-data-sources/4411/1 "2019-10-24T05:31:48Z")

</div>

Hi,  
I am trying to join tables from two different data sources. i want to understand the backed process like how Dremio joins data from datasource1.table1 and merge with datasource2.table2

is Dremio transferring data from one source to another?

---

<div class="post-metadata">

**Author:** ![Venugopal\_Menda](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/venugopal_menda/32/1457_2.png) [@Venugopal\_Menda](https://community.dremio.com/u/Venugopal_Menda)\
**Post date:** [October 24, 2019, 7:04am UTC](https://community.dremio.com/t/how-join-works-with-two-different-data-sources/4411/2 "2019-10-24T07:04:15Z")

</div>

@madhusudhan

Based on the query Dremio prepares the plan to read the erquired data/columns/rows from the both sources and provides the results.Dremio do not transfer any data from one source to other.

@Venugopal_Menda

---

<div class="post-metadata">

**Author:** ![madhusudhan](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@madhusudhan](https://community.dremio.com/u/madhusudhan)\
**Post date:** [October 24, 2019, 7:46am UTC](https://community.dremio.com/t/how-join-works-with-two-different-data-sources/4411/3 "2019-10-24T07:46:35Z")

</div>

you mean that every time when we a query Dremio fetches the data through network?

---

<div class="post-metadata">

**Author:** ![Venugopal\_Menda](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/venugopal_menda/32/1457_2.png) [@Venugopal\_Menda](https://community.dremio.com/u/Venugopal_Menda)\
**Post date:** [October 24, 2019, 8:32am UTC](https://community.dremio.com/t/how-join-works-with-two-different-data-sources/4411/4 "2019-10-24T08:32:13Z")

</div>

Yes we read data for each query. Dremio has a feature called refelctions which stores the data in parquet format, using reflections the query accelerates and finishes in quick time.

Reflections: [https://docs.dremio.com/acceleration/](https://docs.dremio.com/acceleration/)

---

<div class="post-metadata">

**Author:** ![madhusudhan](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@madhusudhan](https://community.dremio.com/u/madhusudhan)\
**Post date:** [October 28, 2019, 9:24am UTC](https://community.dremio.com/t/how-join-works-with-two-different-data-sources/4411/5 "2019-10-28T09:24:59Z")

</div>

Thanks @Venugopal_Menda !  
i need some more clarification on joins with filters.

when i am joining two tables from different data sources by applying filter on data, i want to understand where the data will get filtered. i mean will the dremio read complete data and then filter it or is there any mechanism, that will filter the data and then fetch it?

---

<div class="post-metadata">

**Author:** ![ben](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/ben/32/1367_2.png) [@ben](https://community.dremio.com/u/ben)\
**Post date:** [October 28, 2019, 4:25pm UTC](https://community.dremio.com/t/how-join-works-with-two-different-data-sources/4411/6 "2019-10-28T16:25:30Z")

</div>

Hello @madhusudhan,

Depending on the types of sources you are joining, sometimes Dremio will push down the filter into the source (pre-filter) and sometimes it will grab many records from the source and filter in Dremio’s execution engine. Which source would you be joining across?

---

<div class="post-metadata">

**Author:** ![madhusudhan](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@madhusudhan](https://community.dremio.com/u/madhusudhan)\
**Post date:** [October 29, 2019, 5:25am UTC](https://community.dremio.com/t/how-join-works-with-two-different-data-sources/4411/7 "2019-10-29T05:25:06Z")

</div>

ben, i am joining data from S3 and postgresql.
