-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[KQL]: Autocomplete performance issues with runtime fields #75647
Comments
Pinging @elastic/kibana-app-arch (Team:AppArch) |
I'm conflicted here. I understand there will be a performance issue, we do want to have runtime fields behave like any other field. My question is whether we can have an advance setting for turning on/off the runtime field suggestions (I expect filters will work the same)? |
@stacey-gammon - can you give an example of the query that goes to ES to provide the KQL suggestions? Trying to see the scale of the impact - e.g. are we querying across all docs, a recent set of docs, using sampling, etc? And how aggressively do we run the requests? e.g. for each keystroke, or do we run only after a stretch of typing is completed? |
They query looks like:
Looks like we have a 500ms debounce so it's not every keystroke (https://github.com/elastic/kibana/pull/48450/files#diff-b24c79dfa3f4f9234e3cc6791640655dR77) We have an open issue regarding performances issues with field value suggestions: #46054. Runtime fields would make this worse. |
It sounds like, in the current design, we have no way (through the field_caps API which we use to populate index patterns) to know whether a field is a regular or runtime field. Is that a correct assumption? If that's the case, then I'm not sure how we would have an advanced setting to toggle this behavior on/off. Currently, we only request value suggestions for aggregatable fields of type |
@lukasolson - My understanding is that the ES folks will add this information to field_caps if we need it. |
It's an open discussion. We'd prefer that nobody needs this info in field_caps, because it introduces special treatment for runtime fields which means that they won't be "just like any other field". I think it would be good to discuss options to solve the problem mentioned in this issue. |
APM and Logs UI use custom query bars which use App Arch's auto complete suggestion services. Unless they do extra work to filter runtime fields out, they will end up requesting field value suggestions for runtime fields as well. Do we have an idea for how bad these performance issues will be? Is the recommendation from ES "definitely do not do this" or, "watch out for this"? @lukasolson or @lizozom - Is there any logic that cancels the previous request as a new one is sent out, as the user continues typing? cc @sqren and @weltenwort |
Yes, we are cancelling the previous requests when a new query is issued (both for KQL value suggestions and for filter editor suggestions). |
@sqren or @weltenwort - are you cancelling outdated queries as well? |
Not in the kibana/x-pack/plugins/infra/public/containers/with_kuery_autocompletion.tsx Lines 78 to 86 in d6c45a2
But we could cancel if the API allows for it. It might also be worth considering this in a broader "make it slow" context. Won't searchable snapshots cause a similar performance problem? Can we solve it in a more abstract way by setting a parsimonious timeout? |
A few time I heard runtime fields should be "just like any other field". So that would mean we shouldn't treat them differently and assume no performance penalty ? |
@ppisljar that would be preferable. I was in touch with Stacey yesterday about this, I am going to look at this issue and gather more context so we can discuss it in depth with the team and find a way forward. |
We decided to keep this as a general issue with autocomplete performance which is being tracked here: #46054 We shouldn't do anything special with runtime fields. We'll live with the fact that they will be slow for suggestions and try to solve that via a new ES endpoint that would help all slow suggestions, not just runtime fields. Closing in favor of #46054 |
Runtime fields will soon be addable to an Elasticsearch mapping (#75469).
When they do, KQL and the query bar will have to explicitly filter out field value suggestions for runtime fields, or there will be performance issues.
In order to do this, we'll have to know which fields returned from the field capabilities API are runtime fields.
LOE: TBD
cc @alexh97 @mattkime @ppisljar @jimczi @AlonaNadler
The text was updated successfully, but these errors were encountered: