Skip to content

Conversation

@nik9000
Copy link
Member

@nik9000 nik9000 commented Feb 11, 2021

This fixed "filter by filter" execution order so it doesn't ignore
doc_count. The "filter by filter" execution is fairly performance
sensitive but when I reran performance numbers everything looked fine.

This fixed "filter by filter" execution order so it doesn't ignore
`doc_count`. The "filter by filter" execution is fairly performance
sensitive but when I reran performance numbers everything looked fine.
@elasticmachine elasticmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Feb 11, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo (Team:Analytics)

- match: { aggregations.f.buckets.foo.doc_count: 8 }
- match: { aggregations.f.buckets.xyz.doc_count: 5 }
- match: { profile.shards.0.aggregations.0.type: FiltersAggregator.FilterByFilter }
- gte: { profile.shards.0.aggregations.0.debug.segments_with_doc_count: 1 }
Copy link
Member Author

Choose a reason for hiding this comment

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

I figure it'll be nice to see this in the profile so if it is 0 we can know we didn't need to do anything fancy to get the doc count.


@Override
public String toString() {
return "doc counts are " + (alwaysOne() ? "always one" : "based on " + docCountPostings);
Copy link
Member Author

Choose a reason for hiding this comment

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

I used this while debugging. We certainly don't need it but if folks don't object I'd like to keep it. I'm sure I'll bump into this class later on and this helps.

Counter counter = new Counter(docCountProvider);
if (false == docCountProvider.alwaysOne()) {
segmentsWithDocCount++;
}
Copy link
Member Author

Choose a reason for hiding this comment

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

It's possible to use a different Counter implementation that always returns 1 when the provider will always return one. I trust the jvm to inline the calls on it regardless because counter is effectively final. It'd save a couple of comparisons in this very very hot section. But performance tests seemed fine so I didn't end up doing it.

Copy link
Contributor

@csoulios csoulios left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks Nik!

@nik9000 nik9000 merged commit 477d287 into elastic:master Feb 17, 2021
@nik9000
Copy link
Member Author

nik9000 commented Feb 17, 2021

Thanks @not-napoleon and @csoulios! I've merged and will backport.

nik9000 added a commit to nik9000/elasticsearch that referenced this pull request Feb 17, 2021
)

This fixed "filter by filter" execution order so it doesn't ignore
`doc_count`. The "filter by filter" execution is fairly performance
sensitive but when I reran performance numbers everything looked fine.
nik9000 added a commit to nik9000/elasticsearch that referenced this pull request Feb 18, 2021
)

This fixed "filter by filter" execution order so it doesn't ignore
`doc_count`. The "filter by filter" execution is fairly performance
sensitive but when I reran performance numbers everything looked fine.
nik9000 added a commit that referenced this pull request Feb 18, 2021
…69159)

This fixed "filter by filter" execution order so it doesn't ignore
`doc_count`. The "filter by filter" execution is fairly performance
sensitive but when I reran performance numbers everything looked fine.
nik9000 added a commit that referenced this pull request Feb 18, 2021
…69193)

This fixed "filter by filter" execution order so it doesn't ignore
`doc_count`. The "filter by filter" execution is fairly performance
sensitive but when I reran performance numbers everything looked fine.
nik9000 added a commit that referenced this pull request Feb 19, 2021
nik9000 added a commit that referenced this pull request Feb 19, 2021
nik9000 added a commit that referenced this pull request Feb 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/Aggregations Aggregations >bug Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v7.11.2 v7.12.0 v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants