Skip to content

[Transform] optmize histogam group_by change detection #74031

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

Merged
merged 3 commits into from
Jun 14, 2021

Conversation

hendrikmuhs
Copy link

@hendrikmuhs hendrikmuhs commented Jun 10, 2021

implement a simple change optimization for histograms using min and max aggregations. The optimization is not applied if the range cutoff would be too small compared to the overall range from previous checkpoints. At least 20% must be cut compared to former checkpoints.

fixes #63801

The histogram case is tough, depending on the meaning of the value. If the value is a metric value it might not make sense to optimize this case as the range might be spread across the full range for all checkpoints. If the number is a case or issue number, I think terms should be used.

The most common scenario I am aware of is a monotonic increasing sequence number generated externally. For this case, the optimization should yield good results. I kept it simple, the change collector only remembers values in memory, so the transform has to run some checkpoints until it kicks in.

@elasticmachine
Copy link
Collaborator

Pinging @elastic/ml-core (Team:ML)

@hendrikmuhs hendrikmuhs force-pushed the transform-optimize-histogram branch from a519b38 to 38a31b9 Compare June 14, 2021 08:18
@przemekwitek przemekwitek self-requested a review June 14, 2021 08:49
minAggregationOutputName = COMPOSITE_AGGREGATION_NAME + "." + targetFieldName + ".min";
maxAggregationOutputName = COMPOSITE_AGGREGATION_NAME + "." + targetFieldName + ".max";

// the time field for the date histogram is different than for sync
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I don't understand how does this comment relate to the surrounding code.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 copy paste error ;-)

Copy link
Contributor

@przemekwitek przemekwitek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hendrikmuhs hendrikmuhs merged commit d51b995 into elastic:master Jun 14, 2021
@hendrikmuhs hendrikmuhs deleted the transform-optimize-histogram branch June 14, 2021 14:44
hendrikmuhs pushed a commit that referenced this pull request Jun 15, 2021
…74109)

implement a simple change optimization for histograms using min and max aggregations. The
optimization is not applied if the range cutoff would be too small compared to the overall
range from previous checkpoints. At least 20% must be cut compared to former checkpoints.

fixes #63801
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Transform] Continuous: Optimize change collection for histogram
4 participants