# Can query fetches be routed to a different database

**URL:** <https://discuss.elastic.co/t/can-query-fetches-be-routed-to-a-different-database/77091>\
**Category:** Elasticsearch\
**Created:** [March 2, 2017, 5:57am UTC](https://discuss.elastic.co/t/can-query-fetches-be-routed-to-a-different-database/77091 "2017-03-02T05:57:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Suresh\_Narasimhan](https://avatars.discourse-cdn.com/v4/letter/s/4af34b/32.png) [@Suresh\_Narasimhan](https://discuss.elastic.co/u/Suresh_Narasimhan)\
**Post date:** [March 2, 2017, 5:57am UTC](https://discuss.elastic.co/t/can-query-fetches-be-routed-to-a-different-database/77091/1 "2017-03-02T05:57:11Z")

</div>

From the the slow logs I see that index.search.slowlog.fetch and QUERY\_AND\_FETCH slow for queries. my understanding is this where the ES fetches the documents after it determines the ids in the QUERY phase.

I am thinking of keeping just ids in elasticsearch and move the document to redis , can i change elasticsearch to do the fetches from redis? or should I get back the ids from ES and then do a redis fetch?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [March 2, 2017, 7:52am UTC](https://discuss.elastic.co/t/can-query-fetches-be-routed-to-a-different-database/77091/2 "2017-03-02T07:52:03Z")

</div>

> [@Suresh\_Narasimhan](#):
>
> I am thinking of keeping just ids in elasticsearch and move the document to redis , can i change elasticsearch to do the fetches from redis?

You cannot do that.  
Why would you want to anyway?

---

<div class="post-metadata">

**Author:** ![Suresh\_Narasimhan](https://avatars.discourse-cdn.com/v4/letter/s/4af34b/32.png) [@Suresh\_Narasimhan](https://discuss.elastic.co/u/Suresh_Narasimhan)\
**Post date:** [March 2, 2017, 4:10pm UTC](https://discuss.elastic.co/t/can-query-fetches-be-routed-to-a-different-database/77091/3 "2017-03-02T16:10:06Z")

</div>

> [@warkolm](#):
>
> do that.Why would you want to anyway?

From the slow logs fetches seem slow, I am seeing this might be to do with disk IO so instead of storing the documents in disk in ES thought it will be better idea to use ES for searching /faceting/ filtering but the actual document fetch could be from in memory datastore

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 30, 2017, 4:10pm UTC](https://discuss.elastic.co/t/can-query-fetches-be-routed-to-a-different-database/77091/4 "2017-03-30T16:10:18Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
