Skip to content

Optimize lone single bucket date_histogram (backport of #71180)#72989

Merged
nik9000 merged 1 commit intoelastic:7.xfrom
nik9000:field_exists_speedy_7_x
May 12, 2021
Merged

Optimize lone single bucket date_histogram (backport of #71180)#72989
nik9000 merged 1 commit intoelastic:7.xfrom
nik9000:field_exists_speedy_7_x

Conversation

@nik9000
Copy link
Copy Markdown
Member

@nik9000 nik9000 commented May 12, 2021

This optimizes the date_histogram agg when there is a single bucket
and no sub-aggregations. We expect this to happen from time to time when
the buckets are larger than a day because folks often use "daily"
indices.

This was already fairly fast, but using the metadata makes it 10x
faster. Something like 98ms becomes 7.5ms. Nice if you can get it!

Like #69377 this optimization will disable itself if you have document
level security enabled or are querying a rollup index. Also like #69377
it won't do anything if there is a top level query.

This optimizes the `date_histogram` agg when there is a single bucket
and no sub-aggregations. We expect this to happen from time to time when
the buckets are larger than a day because folks often use "daily"
indices.

This was already fairly fast, but using the metadata makes it 10x
faster. Something like 98ms becomes 7.5ms. Nice if you can get it!

Like elastic#69377 this optimization will disable itself if you have document
level security enabled or are querying a rollup index. Also like elastic#69377
it won't do anything if there is a top level query.
@nik9000 nik9000 merged commit 3d19468 into elastic:7.x May 12, 2021
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.

1 participant