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

Add rule for unwrapping TIMESTAMP to DATE cast when comparing with DATE literal #11170

Merged
merged 1 commit into from
Feb 28, 2022

Conversation

losipiuk
Copy link
Member

@losipiuk losipiuk commented Feb 23, 2022

Description

Add a rule for unwrapping TIMESTAMP to DATE cast when comparing with DATE literal

Is this change a fix, improvement, new feature, refactoring, or other?

improvement

Is this a change to the core query engine, a connector, client library, or the SPI interfaces? (be specific)

core query engine (optimizer)

How would you describe this change to a non-technical end user or system administrator?

New rule rewrites CAST(ts_column as DATE) OP date_literal to range expression on ts_column. Dropping cast
allows for further optimizations, such as pushdown into connectors.

Documentation

(x) No documentation is needed.
( ) Sufficient documentation is included in this PR.
( ) Documentation PR is available with #prnumber.
( ) Documentation issue #issuenumber is filed, and can be handled later.

Release notes

( ) No release notes entries required.
(x) Release notes entries required with the following suggested text:

# General
* Improve performance of specific queries which compare table columns of type `timestamp` with `date` literals. ({issue}`11170`)

@cla-bot cla-bot bot added the cla-signed label Feb 23, 2022
@losipiuk losipiuk requested review from findepi and martint February 23, 2022 19:26
@findepi
Copy link
Member

findepi commented Feb 25, 2022

cc @kasiafi

@findepi
Copy link
Member

findepi commented Feb 25, 2022

General

Improve performance of specific queries which compare table columns of type timestamp with date literals. ({issue}11170)

this matters especially when timestamp value is a column, and connector supports predicate pushdown.
cc @hashhar @wendigo

@losipiuk losipiuk merged commit 60f81a9 into trinodb:master Feb 28, 2022
@github-actions github-actions bot added this to the 372 milestone Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants