# Performance Consideration - Statical Facets vs Query?

**URL:** <https://discuss.elastic.co/t/performance-consideration-statical-facets-vs-query/34132>\
**Category:** Elasticsearch\
**Created:** [November 9, 2015, 8:54am UTC](https://discuss.elastic.co/t/performance-consideration-statical-facets-vs-query/34132 "2015-11-09T08:54:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hagai\_T](https://avatars.discourse-cdn.com/v4/letter/h/b9e5f3/32.png) [@Hagai\_T](https://discuss.elastic.co/u/Hagai_T)\
**Post date:** [November 9, 2015, 8:54am UTC](https://discuss.elastic.co/t/performance-consideration-statical-facets-vs-query/34132/1 "2015-11-09T08:54:48Z")

</div>

Hi,

I am using Elasticsearch 1.4.2 with Kibana 3 for analytics in a high scales (few TBs per day).  
I'm facing a decision to understand which one of the approaches will give me better performance in terms of resource consumption and speed - Statical facets or Query.

Which one of the searches are heavier and consume more resources:

**- Using Query -**  
"facets": {  
"stats": {  
"statistical": {  
"field": "timestamparrival"  
},  
"facet\_filter": {  
"fquery": {  
"query": {  
"filtered": {  
"query": {  
"bool": {  
"should": [  
{  
"query\_string": {  
"query": "e:"sdqq" AND NOT name:"drr""  
}  
}  
]  
}  
},  
"filter": {  
"bool": {  
"must": [  
{  
"range": {  
"timestamparrival": {  
"from": 1447057419440,  
"to": 1447058319441  
}  
}  
}  
]  
}  
}  
}  
}  
}  
}  
},  
"stats\_impressions": {  
"statistical": {  
"field": "timestamparrival"  
},  
"facet\_filter": {  
"fquery": {  
"query": {  
"filtered": {  
"query": {  
"bool": {  
"should": [  
{  
"query\_string": {  
"query": "e:"dspimp" AND NOT advname:"looper""  
}  
}  
]  
}  
},  
"filter": {  
"bool": {  
"must": [  
{  
"range": {  
"timestamparrival": {  
"from": 1447057419442,  
"to": 1447058319443  
}  
}  
}  
]  
}  
}  
}  
}  
}  
}  
}  
},  
"size": 0  
}'

**- Using Statistical Facets:**  
"facets": {  
"stats": {  
"statistical": {  
"field": "ecf.adops"  
},  
"facet\_filter": {  
"fquery": {  
"query": {  
"filtered": {  
"query": {  
"bool": {}  
},  
"filter": {  
"bool": {  
"must": [  
{  
"range": {  
"timestamparrival": {  
"from": 1447058065918,  
"to": 1447058965919  
}  
}  
}  
]  
}  
}  
}  
}  
}  
}  
}  
},  
"size": 0  
}'

Note: ecf.adops field contains 1 or 0 and in Kibana I configured to sum it.  
You're help is very appreciate.

Thank you in advance,  
Hagai.

---

<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 5, 2017, 11:39pm UTC](https://discuss.elastic.co/t/performance-consideration-statical-facets-vs-query/34132/2 "2017-07-05T23:39:48Z")

</div>

Closed on July 5, 2017, 11:39pm UTC


