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

parser: lowercase timespans in extract #59598

Merged
merged 1 commit into from
Jan 31, 2021

Conversation

jordanlewis
Copy link
Member

Touches #19965. Confirmed that this (relatively silly) PR gets rid of the allocations in the experiment listed in #19965 (comment)

The extract builtin is kind of weird - it is actually supported by the
parser and not an ordinary builtin function that people can call without
parser support. As such, we can normalize its inputs right in the
parser.

The benefit of this is that, later, we are going to unconditionally
ToLower() the string arguments to extract - which costs an allocation.
So we can do this normalization up front to save a bunch of allocations
in queries that run extract over a lot of data rows.

Release note (performance improvement): improve the allocation
performance of workloads that use the EXTRACT builtin.

The `extract` builtin is kind of weird - it is actually supported by the
parser and not an ordinary builtin function that people can call without
parser support. As such, we can normalize its inputs right in the
parser.

The benefit of this is that, later, we are going to unconditionally
ToLower() the string arguments to extract - which costs an allocation.
So we can do this normalization up front to save a bunch of allocations
in queries that run `extract` over a lot of data rows.

Release note (performance improvement): improve the allocation
performance of workloads that use the `EXTRACT` builtin.
@jordanlewis jordanlewis requested a review from a team January 29, 2021 21:53
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@jordanlewis
Copy link
Member Author

bors r+

@craig
Copy link
Contributor

craig bot commented Jan 31, 2021

Build succeeded:

@craig craig bot merged commit 3ca562d into cockroachdb:master Jan 31, 2021
@jordanlewis jordanlewis deleted the reduce-timespan-allocs branch January 31, 2021 23:04
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.

3 participants