[Discover][ES|QL] Improve changing of index pattern performance #169835
Labels
Feature:Data Views
Data Views code and UI - index patterns before 8.0
Feature:Discover
Discover Application
Feature:ES|QL
ES|QL related features in Kibana
impact:medium
Addressing this issue will have a medium level of impact on the quality/strength of our product.
loe:small
Small Level of Effort
performance
Team:DataDiscovery
Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL.
When using ES|QL, there's a different index pattern entered, behind the scenes there's a request for all fields started. This request needs to be completed for the actual data fetching to be started. This step is necessary to get information if there's a
@timestamp
field available and of typedate
. Here's the code:kibana/src/plugins/discover/public/application/main/utils/get_data_view_by_text_based_query_lang.ts
Lines 35 to 42 in 5d68129
What can be improved here is to just request what's needed, which is the information of the availability of the field. When DataViewLazy is available (#167750), this can be improved to just fetch the one field of interest. This can significantly boost performance, when the field list takes a long time to load.
Testing kibana_sample_data_logs in DevTools
Testing a large logs index pattern in DevTools
Testing a large CCS metrics index pattern in DevTools:
So the time to result would be 14-17s faster
Testing a large CCS logs index pattern in DevTools:
So the time to result would be 3.5-8.4s faster
What's more, depending on the implementation of the cache the field cache #169622 we could also use the fields cache the get the information, if the index pattern fields have already been requested, before sending an request to ES.
The text was updated successfully, but these errors were encountered: