Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Profiling Elasticsearch Queries for Fun and Profit

Elastic Co
February 18, 2016

Profiling Elasticsearch Queries for Fun and Profit

Writing a good query can require experience, intuition, and sometimes, divination. This talk will cover how the Elasticsearch DSL translates to Lucene queries, the stages of query execution, and how the new query profiler can be used to identify slow components and improve performance.

Elastic Co

February 18, 2016
Tweet

More Decks by Elastic Co

Other Decks in Technology

Transcript

  1. 2 Elasticsearch 2.2 received a profiler! • Attempts to time

    execution of query components • Best-effort profiling • Expensive! Verbose! “SQL Explain for ES” https://www.elastic.co/guide/en/elasticsearch/reference/current/search-profile.html
  2. 11 Shard 1 Search Request Collector 2 S W Documents

    A request can use multiple collectors
  3. 12 Shard 1 Search Request Collector 2 S W Documents

    A request can use multiple collectors
  4. 13 Shard 1 Search Request Collector 2 S W Documents

    A request can use multiple collectors
  5. 14 And a request can hit multiple shards Search Request

    Shard 1 Documents Shard 2 Documents
  6. ‹#› Please attribute Elastic with a link to elastic.co Except

    where otherwise noted, this work is licensed under http://creativecommons.org/licenses/by-nd/4.0/ Creative Commons and the double C in a circle are registered trademarks of Creative Commons in the United States and other countries. Third party marks and brands are the property of their respective holders. 18