Skip to content
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] Build index pattern field map for O(1) access #82243

Closed
flash1293 opened this issue Nov 2, 2020 · 3 comments · Fixed by #82829
Closed

[Lens] Build index pattern field map for O(1) access #82243

flash1293 opened this issue Nov 2, 2020 · 3 comments · Fixed by #82829
Labels
Feature:Lens performance Team:Visualizations Visualization editors, elastic-charts and infrastructure technical debt Improvement of the software architecture and operational architecture
Projects

Comments

@flash1293
Copy link
Contributor

flash1293 commented Nov 2, 2020

Currently the Lens-specific IndexPattern type only contains an array of field which is used in a lot of places to find a field by name.

This is problematic if the index pattern has a lot of fields.

To improve performance, the loader should expose the data index pattern object already providing this functionality by getFieldByName.

By completely removing the local index pattern type we can also remove redundancy and a bit of the complexity of Lens.

@flash1293 flash1293 added performance technical debt Improvement of the software architecture and operational architecture Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Lens labels Nov 2, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@flash1293 flash1293 added this to Long-term goals in Lens via automation Nov 2, 2020
@flash1293 flash1293 added the good first issue low hanging fruit label Nov 2, 2020
@wylieconlon
Copy link
Contributor

I agree this would be nice, but also want to point out that this is another place where we're duplicating effort in Lens + the Index Pattern service. Would be nice if we could start removing some of the Lens-specific handling, and it might even improve performance if we did. As a reminder this is tech debt because Lens was started before the index pattern service was easily shareable.

@flash1293 flash1293 removed the good first issue low hanging fruit label Nov 3, 2020
@flash1293
Copy link
Contributor Author

Good point @wylieconlon - I agree it's probably a better approach to move away from the Lens-specific index pattern type and just use data index pattern objects directly. I will change the description to reflect this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Lens performance Team:Visualizations Visualization editors, elastic-charts and infrastructure technical debt Improvement of the software architecture and operational architecture
Projects
No open projects
Lens
  
Done
3 participants