Why my term query slow?

I configure the following parameter, but my query is still very slow.
"index.store.preload": ["nvd", "dvd", "tim", "doc", "dim"]

my dsl as follw:
{"query": { "bool":{"filter":{"bool":{"must":[{"term" : { "ALL" :"hvc" }},{"term" : { "ALL" :"vcr" }},{"term" : { "ALL" :"crr" }},{"term" : { "ALL" :"rrt" }},{"term" : { "ALL" :"rtx" }},{"term" : { "ALL" :"txp" }},{"term" : { "ALL" :"xph" }},{"term" : { "ALL" :"phj" }},{"term" : { "ALL" :"hjb" }},{"term" : { "ALL" :"jby" }},{"term" : { "ALL" :"byl" }},{"term" : { "ALL" :"yls" }},{"term" : { "ALL" :"lsu" }},{"term" : { "ALL" :"sun" }},{"term" : { "ALL" :"unq" }},{"term" : { "ALL" :"nqs" }},{"term" : { "ALL" :"qsv" }},{"term" : { "ALL" :"svd" }},{"term" : { "ALL" :"vdl" }},{"term" : { "ALL" :"dlr" }},{"term" : { "ALL" :"lru" }},{"term" : { "ALL" :"rul" }},{"term" : { "ALL" :"ulv" }},{"term" : { "ALL" :"lvl" }},{"term" : { "ALL" :"vlj" }},{"term" : { "ALL" :"ljv" }},{"term" : { "ALL" :"jvl" }},{"term" : { "ALL" :"vlq" }}]}}}}}

What is the response ?

@dadoonet thanks for your reply.

the response is :

{
  "took" : 19292,
  "timed_out" : false,
  "_shards" : {
    "total" : 10,
    "successful" : 10,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : 1,
    "max_score" : 0.0,

I found this comment in the elasticsearch6.1.3‘s source code about index.store.preload

   /** On which extensions to load data into the file-system cache upon opening of files.
     *  This only works with the mmap directory, and even in that case is still
     *  best-effort only. */

my index.store.type is niofs, maybe I mismatched this parameter.

How big is the index and what are the specs of your servers? Could you also post a profile of your query? https://www.elastic.co/guide/en/elasticsearch/reference/current/search-profile.html

I guess that all the terms are quite common which should result in a high nextdoc count in the profiler output which would explain what is taking so long.

Hi @Lumaraf ,the nextdoc costs 82.8% of the time, what optimization can i do?
image

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.