# Priority between reflections

**URL:** <https://community.dremio.com/t/priority-between-reflections/4516>\
**Category:** Uncategorized\
**Created:** [November 6, 2019, 1:59pm UTC](https://community.dremio.com/t/priority-between-reflections/4516 "2019-11-06T13:59:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ssky](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@ssky](https://community.dremio.com/u/ssky)\
**Post date:** [November 6, 2019, 1:59pm UTC](https://community.dremio.com/t/priority-between-reflections/4516/1 "2019-11-06T13:59:50Z")

</div>

Hi,

I have a question about the priority between reflections ! how the optimizer do choose when there multiple reflections that can respond !  
I have a PDS with a reflection on it  
I created a VDS (based on the previous PDS), and I added some calculated columns on it, then I created a reflections on this VDS (with included the derived columns)

the good thing, is that the VDS reflection is accelerated by the PDS reflections  
and when I do a select from the VDS, the query is accelerated by the VDS reflection  
But, when I do a select from the VDS join another PDS (no reflection defined on it)  
the query is not accelerated by the VDS reflections any more but by the PDS reflection ?

And I can’t understand why is it so ?

---

<div class="post-metadata">

**Author:** ![balaji.ramaswamy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/balaji.ramaswamy/32/843_2.png) [@balaji.ramaswamy](https://community.dremio.com/u/balaji.ramaswamy)\
**Post date:** [November 6, 2019, 2:24pm UTC](https://community.dremio.com/t/priority-between-reflections/4516/2 "2019-11-06T14:24:00Z")

</div>

@ssky

We do costing of using different reflection during the planning phase. We are also working on some fixes similar to the problem you are describing. Would you be able to send us the job profile for the the query that you think should have used the reflection on the VDS but it ends up substituting the one on the PDS?

[Share Dremio query profile](https://www.dremio.com/tutorials/share-query-profile-dremio/)

---

<div class="post-metadata">

**Author:** ![ssky](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@ssky](https://community.dremio.com/u/ssky)\
**Post date:** [November 6, 2019, 2:45pm UTC](https://community.dremio.com/t/priority-between-reflections/4516/3 "2019-11-06T14:45:02Z")

</div>

Hi balaji,

here is the job profile

[1e1829e3-955f-468a-addb-1e13b023fe01.zip](https://community.dremio.com/uploads/short-url/gPOmEWNA2ESMfFgAXcl1oL2olKT.zip) (67,3 Ko)

thanks

---

<div class="post-metadata">

**Author:** ![balaji.ramaswamy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/balaji.ramaswamy/32/843_2.png) [@balaji.ramaswamy](https://community.dremio.com/u/balaji.ramaswamy)\
**Post date:** [November 6, 2019, 5:17pm UTC](https://community.dremio.com/t/priority-between-reflections/4516/4 "2019-11-06T17:17:19Z")

</div>

Sorry @ssky, forgot to mention that we need verbose profile to confirm the behavior we are suspecting. Click on admin-support-support key-enter “planner.verbose\_profile”-click show-enable-save, run the query again and send us the profile again

---

<div class="post-metadata">

**Author:** ![ssky](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@ssky](https://community.dremio.com/u/ssky)\
**Post date:** [November 7, 2019, 8:11am UTC](https://community.dremio.com/t/priority-between-reflections/4516/5 "2019-11-07T08:11:40Z")

</div>

Hi balaji,

As requested here’s the verbose job profile

[a30fc7f6-0a66-4ef9-960e-ccc77c72e94d.zip](https://community.dremio.com/uploads/short-url/ceKaBrXjya4uqx3PD78uyj8b5uW.zip) (67,3 Ko)

thanks
