-
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
[Lens] Avoid index pattern remapping for each visualization #89269
Comments
Pinging @elastic/kibana-app (Team:KibanaApp) |
I've run some investigation in the topic and found that, maybe, we're already taking advantage of the
After discussing with @wylieconlon , there are still probably some open questions around performance here:
|
Yes, we are hitting the data plugin index pattern cache, this issue is about the re-mapping of index patterns within Lens (
The data plugin takes care of that, it will only do the work once even if the same index pattern is requested at once multiple times. |
Chatted with @mattkime about this and the data view instances delivered from the service are not immutable and might change field lists in some cases, so we can't use it as a cache key. However I'm not sure whether refactoring as described above would be a good idea as the instances not serializable as well. Not sure about the right way forward here... @mbondyra what do you think about putting the data view instances directly into the redux store? |
Data views have some unserialisable data so we'd break one of the redux state rules there, but it's not the first time we'd do it anyway. I wonder if we could load data views before creating the store and have it as a dependency same way as |
It's too expensive to preload all data views - we need an approach to do this on the fly. I like the idea of moving this to the frame level though. Maybe we can introduce a mechanism on the datasource to report a list of data views it requires, and the frame loads them async and then calls the sync functions of the data source, passing in the list of data view instances. I'm not sure whether they need to be in the redux state, we just put them in there so the datasource can use it in all places as the state is already passed into every function. That would mean there are no data views in the state anymore, neither re-mapped nor unmapped. It's a pretty large refactoring though, but one that would reduce some complexity as we could remove the async initialization method of data sources; we just keep that around for the data views. |
Caching the fieldlist solves this problem! Will be available in 8.13! |
In our current setup, the datasource initializes itself when a Lens visualization is loaded on a dashboard. This includes calling
loadIndexPatterns
, which loads the used index patterns and builds a map for all existing fields. As this is happening for each visualization individually, a large dashboard built with large index patterns can cause performance issues:There are two options how we can improve this:
The text was updated successfully, but these errors were encountered: