# Reflections are not used if accessed from virtual table

**URL:** https://community.dremio.com/t/reflections-are-not-used-if-accessed-from-virtual-table/4838
**Category:** Uncategorized
**Created:** [December 31, 2019, 6:58pm UTC](https://community.dremio.com/t/reflections-are-not-used-if-accessed-from-virtual-table/4838 "2019-12-31T18:58:29Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![kprifogle](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/kprifogle/32/1719_2.png) [@kprifogle](https://community.dremio.com/u/kprifogle)
#### Post date: [December 31, 2019, 6:58pm UTC](https://community.dremio.com/t/reflections-are-not-used-if-accessed-from-virtual-table/4838/1 "2019-12-31T18:58:29Z")

</div>

I have a virtual table (call it table\_a) that represents a query that is querying other tables with raw and aggregate reflections. If I go into EDIT original SQL for table\_a and add:

SELECT COUNT(\*) FROM (

rest of table\_a query

)

Then it uses the reflections and the query runs quickly. However if I simply run:

SELECT COUNT(\*) FROM table\_a

then the reflections are not used.

This behavior is totally unexpected.

---

<div class="post-metadata">

### Author: ![doron](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/doron/32/294_2.png) [@doron](https://community.dremio.com/u/doron)
#### Post date: [December 31, 2019, 10:03pm UTC](https://community.dremio.com/t/reflections-are-not-used-if-accessed-from-virtual-table/4838/2 "2019-12-31T22:03:54Z")

</div>

Can you please provide us profiles for both queries ([https://www.dremio.com/tutorials/share-query-profile-dremio/](https://www.dremio.com/tutorials/share-query-profile-dremio/)) so we can see what is going on.

---

<div class="post-metadata">

### Author: ![kprifogle](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/kprifogle/32/1719_2.png) [@kprifogle](https://community.dremio.com/u/kprifogle)
#### Post date: [January 1, 2020, 12:57am UTC](https://community.dremio.com/t/reflections-are-not-used-if-accessed-from-virtual-table/4838/3 "2020-01-01T00:57:43Z")

</div>

I’ll PM you and summarize any resolution here as the metadata may contain sensitive information.

---

<div class="post-metadata">

### Author: ![kprifogle](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/kprifogle/32/1719_2.png) [@kprifogle](https://community.dremio.com/u/kprifogle)
#### Post date: [January 27, 2020, 6:43pm UTC](https://community.dremio.com/t/reflections-are-not-used-if-accessed-from-virtual-table/4838/4 "2020-01-27T18:43:43Z")

</div>

Updating here for posterity, the only proposed solution was to upgrade dremio 😕
