# Reflections not used

**URL:** https://community.dremio.com/t/reflections-not-used/10548
**Category:** Uncategorized
**Created:** [April 21, 2023, 4:27pm UTC](https://community.dremio.com/t/reflections-not-used/10548 "2023-04-21T16:27:32Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![jbaranda](https://avatars.discourse-cdn.com/v4/letter/j/e68b1a/32.png) [@jbaranda](https://community.dremio.com/u/jbaranda)
#### Post date: [April 21, 2023, 4:27pm UTC](https://community.dremio.com/t/reflections-not-used/10548/1 "2023-04-21T16:27:32Z")

</div>

Hi! I am using Dremio software community edition v23.0 in my EKS cluster. I have a virtual dataset that uses a complex query that involves 6 joins of tables with millions of rows. Every time I try to query it takes like 20 minutes to load so I wanted to create reflections to speed it up, but my reflections are never used.

This is how my query looks like:

SELECT distinct colum1, colum2,…colum50  
FROM (  
SELECT \* FROM  
Space.“virtual\_dataset\_name\_1”  
left join (SELECT \* FROM Space.“virtual\_dataset\_name\_2”  
inner join Space.“virtual\_dataset\_name\_3”  
on column1 = column2)  
…  
left join Space.“virtual\_dataset\_name\_6”  
on aipd.column6 = column7  
) nested\_0

I have tried creating a raw reflection of the whole virtual dataset but that doesn’t use the reflection, also I tried creating a raw reflection of the virtual dataset Space.“virtual\_dataset\_name\_2” which is queried inside the complex query of the virtual dataset I want to speed up. Lastly I tried creating a reflection of the physical dataset of one of the joins.But the reflection is never used. What am I doing wrong?

---

<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: [April 24, 2023, 6:36pm UTC](https://community.dremio.com/t/reflections-not-used/10548/2 "2023-04-24T18:36:59Z")

</div>

@jbaranda Can you please send job profiles for

- Query that ran before reflection was created
- REFRESH REFLECTION job
- Query that ran after reflection was created but reflection was not leveraged

---

<div class="post-metadata">

### Author: ![Benny\_Chow](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/benny_chow/32/5527_2.png) [@Benny\_Chow](https://community.dremio.com/u/Benny_Chow)
#### Post date: [April 25, 2023, 6:06am UTC](https://community.dremio.com/t/reflections-not-used/10548/3 "2023-04-25T06:06:53Z")

</div>

@jbaranda If you are having issues with reflection matching on v23 especially with VARCHAR data types, then you should upgrade to v24.

---

<div class="post-metadata">

### Author: ![jbaranda](https://avatars.discourse-cdn.com/v4/letter/j/e68b1a/32.png) [@jbaranda](https://community.dremio.com/u/jbaranda)
#### Post date: [May 30, 2023, 4:34pm UTC](https://community.dremio.com/t/reflections-not-used/10548/4 "2023-05-30T16:34:16Z")

</div>

Hi! Here I attach all the jobs. Here you can see that the reflection is not used. I am sorry for the late reply, I didn’t saw the message replies.  
[query\_profile\_after\_reflection.zip](https://community.dremio.com/uploads/short-url/YZbbiGwSTKXE5B0WH8FuqOYmAH.zip) (326.0 KB)  
[reflection\_profile.zip](https://community.dremio.com/uploads/short-url/ukT97evLatA0RZ60tlD4JyDvN8D.zip) (335.2 KB)

---

<div class="post-metadata">

### Author: ![jbaranda](https://avatars.discourse-cdn.com/v4/letter/j/e68b1a/32.png) [@jbaranda](https://community.dremio.com/u/jbaranda)
#### Post date: [May 30, 2023, 4:34pm UTC](https://community.dremio.com/t/reflections-not-used/10548/5 "2023-05-30T16:34:56Z")

</div>

[query\_profile\_before\_reflection.zip](https://community.dremio.com/uploads/short-url/dTqDtCgsP4HsCIALQtqd2oMOebh.zip) (324.1 KB)

---

<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: [June 1, 2023, 5:25pm UTC](https://community.dremio.com/t/reflections-not-used/10548/6 "2023-06-01T17:25:04Z")

</div>

@jbaranda I see the reflection (RAW) is on VDS `STP.meta_denormalized_optimized`

This VDS does not appear in your plan. Is the logic inside this VDS same as the query or one of the VDS’s used in the query so we expect Dremio to match?

---

<div class="post-metadata">

### Author: ![jbaranda](https://avatars.discourse-cdn.com/v4/letter/j/e68b1a/32.png) [@jbaranda](https://community.dremio.com/u/jbaranda)
#### Post date: [June 6, 2023, 7:08pm UTC](https://community.dremio.com/t/reflections-not-used/10548/7 "2023-06-06T19:08:24Z")

</div>

Hi! Yes the reflection is on VDS STP.meta\_denormalized\_optimized. What do you mean by the logic inside the VDS? I created the raw reflection of the VDS that was created with the same query of STP.meta\_denormalized\_optimized. This query at the same time is querying other VDS which do not have RAW reflections themselves. In my first post (message) you can see how my query looks and what things I have tried.

---

<div class="post-metadata">

### Author: ![Benny\_Chow](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/benny_chow/32/5527_2.png) [@Benny\_Chow](https://community.dremio.com/u/Benny_Chow)
#### Post date: [June 6, 2023, 10:47pm UTC](https://community.dremio.com/t/reflections-not-used/10548/8 "2023-06-06T22:47:25Z")

</div>

@jbaranda As I said before, reflection matching is broken on v23 CE edition. You need to upgrade to v24 which is out already. Please don’t use v23 CE edition with reflections.
