原文地址: https://www.elastic.co/guide/en/elasticsearch/reference/7.7/_tune_your_queries_with_the_profile_api.html, 原文档版权归 www.elastic.co 所有
IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
Tune your queries with the Profile APIedit
You can also analyse how expensive each component of your queries and aggregations are using the Profile API. This might allow you to tune your queries to be less expensive, resulting in a positive performance result and reduced load. Also note that Profile API payloads can be easily visualised for better readability in the Search Profiler, which is a Kibana dev tools UI available in all X-Pack licenses, including the free X-Pack Basic license.
Some caveats to the Profile API are that:
- the Profile API as a debugging tool adds significant overhead to search execution and can also have a very verbose output
- given the added overhead, the resulting took times are not reliable indicators of actual took time, but can be used comparatively between clauses for relative timing differences
- the Profile API is best for exploring possible reasons behind the most costly clauses of a query but isn’t intended for accurately measuring absolute timings of each clause