Performance Consideration - Statical Facets vs Query?


(Hagai T) #1

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.


(system) #2