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

Improve efficiency on some elasticsearch queries grouping by computed if/else fields #2491

Merged
merged 3 commits into from
Dec 1, 2023

Conversation

rafaelbey
Copy link
Contributor

What type of PR is this?

Improvement

What does this PR do / why is it needed ?

When grouping by fields that are bucketing using if/else, is more efficient to use filters bucket aggregation rather than scripting a runtime field to group by after. This will avoid the scripting, which can be resource intensive.

Which issue(s) this PR fixes:

Fixes #

Other notes for reviewers:

Does this PR introduce a user-facing change?

@rafaelbey rafaelbey requested a review from a team as a code owner December 1, 2023 04:12
Copy link

github-actions bot commented Dec 1, 2023

Test Results

     708 files  ±  0       708 suites  ±0   1h 2m 36s ⏱️ -22s
11 865 tests +20  11 443 ✔️ +20  422 💤 ±0  0 ±0 
14 860 runs  +20  14 339 ✔️ +20  521 💤 ±0  0 ±0 

Results for commit 474d39b. ± Comparison against base commit e1d4583.

♻️ This comment has been updated with latest results.

@rafaelbey rafaelbey merged commit 965202b into finos:master Dec 1, 2023
3 checks passed
@rafaelbey rafaelbey deleted the es_filters_aggs branch December 1, 2023 23:00
AFine-gs pushed a commit to AFine-gs/legend-engine that referenced this pull request Jan 9, 2024
… if/else fields (finos#2491)

* Improve efficiency on some elasticsearch queries grouping by computed if/else fields

* Handle Date type on painless script

* Ensure else is handle as "other" bucket
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants