# Do multiple routings for a query create multiple queries?

**URL:** <https://discuss.elastic.co/t/do-multiple-routings-for-a-query-create-multiple-queries/8922>\
**Category:** Elasticsearch\
**Created:** [September 4, 2012, 9:24am UTC](https://discuss.elastic.co/t/do-multiple-routings-for-a-query-create-multiple-queries/8922 "2012-09-04T09:24:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![olof](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/olof/32/2721_2.png) [@olof](https://discuss.elastic.co/u/olof)\
**Post date:** [September 4, 2012, 9:24am UTC](https://discuss.elastic.co/t/do-multiple-routings-for-a-query-create-multiple-queries/8922/1 "2012-09-04T09:24:49Z")

</div>

Say I have a cluster of 6 nodes and a single index with 6 shards. I index  
documents to this using a routing based on the hour of the day (so 0 to  
23). This means I have 24 different routings to 6 shards, with each shard  
on a separate node.

So then I want to query this index with a time range both as a filter and  
by putting the hours as routings. For example, I can do the following:  
curl localhost:9200/\_search?routing=09,10,11  
Which should limit the document set I have to filter and search through.  
This request will be distributed to 1-3 shards.

Straightforward, just like this:  
curl localhost:9200/\_search?routing=09,10,11,12,13,14  
This request will be distributed to 1-6 shards.

However, let's say I use twice as many routings as shards:  
curl localhost:9200/\_search?routing=09,10,11,12,13,14,15,16,17,18,19,20  
This request will also be distributed to 1-6 shards, and ES will report  
hitting that many.  
However, I've noticed when testing this seems to be slower than the request  
that goes to just as many shards but with more routings. Even when making  
sure that each routing goes to separate shards for the 6 routing request,  
the 12 routing one seems slower.

I'm wondering if using more routings than shards will make multiple queries  
to the same shard (although the routing code when querying suggests  
otherwise). Or am I missing something here?  
Does elasticsearch collapse routings that go to the same shard?

--

---

<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:** [July 6, 2017, 3:14am UTC](https://discuss.elastic.co/t/do-multiple-routings-for-a-query-create-multiple-queries/8922/2 "2017-07-06T03:14:12Z")

</div>


