How to compare the cost of Search Request

Hi,

I want to optimize index settings, for example, customized _routing parameter, to see if it can improve search performance. The problem is Elasticsearch always cache the query result, so when I run the search for the second time, it's much faster than the first time. I can't baseline the search performance. I tried clear cache but it didn't help.

If the execution time of the search can't tell me whether optimization works, are there any other statistics that I can check? In relational database I can check the EXECUTION PLAN to find the cost of each step. Can I do similar thing in Elasticsearch to find the cost of each Search request?

For my example customized _routing parameter, I can see the number of shards hit has reduced. But this is not enough to prove the performance has improved.

Does https://www.elastic.co/guide/en/elasticsearch/reference/7.6/search-profile.html help?

I'm not sure. Does this Profile API take cache into account?

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