I have document type user and I would like to understand why by using filter it took more time than not applying any filter.
For example imagine I have 1 billion documents, it's like scanning the whole billion record comparing with by filtering with some id.
example query:
{
"from" : 0,
"size" : 10000,
"stored_fields" : ["first_name", "last_name"],
"query":{
"bool": {
"filter": {
"ids" : {
"type" : "user",
"values" : [
"547303",
**"another 200k ids"** ]
}
}
}
}
}
Current benchmark: 1 - Without using filter took around 400 ms 2 - With filter by passing 200k ids will take around 2100 ms