# Is querying for a specific docType inherently more performant?

**URL:** <https://discuss.elastic.co/t/is-querying-for-a-specific-doctype-inherently-more-performant/21966>\
**Category:** Elasticsearch\
**Created:** [February 3, 2015, 11:08pm UTC](https://discuss.elastic.co/t/is-querying-for-a-specific-doctype-inherently-more-performant/21966 "2015-02-03T23:08:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christian\_Henry](https://avatars.discourse-cdn.com/v4/letter/c/eb8c5e/32.png) [@Christian\_Henry](https://discuss.elastic.co/u/Christian_Henry)\
**Post date:** [February 3, 2015, 11:08pm UTC](https://discuss.elastic.co/t/is-querying-for-a-specific-doctype-inherently-more-performant/21966/1 "2015-02-03T23:08:32Z")

</div>

Hi all,

What my question boils down to is this - is it more performant to:

1. Search an index for all data matching a particular docType OR
2. Query an entire index (with one doctype) and filter based on your own  
field. Say this field has the same number of values and approx. number of  
documents on each value as 1).

I know that docType is really just a special field in the final data...and  
since each shard is a lucene index, it's still going to have to search  
through the entire data set on that index at some point in time. My guess  
would be that being able to search indices by docTypes at a high level are  
mostly just for conceptualization purposes and wouldn't make these queries  
any faster, but that it _could_ be the case that ES performs some sort of  
optimization on docType searching behind the scenes.

Thanks!  
Christian

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/f4c3838a-3ea9-4c20-9666-6d07fe69ffa8%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f4c3838a-3ea9-4c20-9666-6d07fe69ffa8%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:35am UTC](https://discuss.elastic.co/t/is-querying-for-a-specific-doctype-inherently-more-performant/21966/2 "2017-07-06T00:35:05Z")

</div>

Closed on July 6, 2017, 12:35am UTC


