Skip to content

Push down NOT, IS NULL, NOT IS NULL in PostgreSQL connector#11514

Merged
findepi merged 2 commits intotrinodb:masterfrom
wendigo:serafin/expression-pushdown-support
Mar 22, 2022
Merged

Push down NOT, IS NULL, NOT IS NULL in PostgreSQL connector#11514
findepi merged 2 commits intotrinodb:masterfrom
wendigo:serafin/expression-pushdown-support

Conversation

@wendigo
Copy link
Copy Markdown
Contributor

@wendigo wendigo commented Mar 16, 2022

Description

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 & PostgreSQL connector.

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

Enables pushdown of NOT expression and IS NULL, NOT IS NULL predicates in PostgreSQL connector

Related issues, pull requests, and links

#9506

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:

#  PostgreSQL connector
* Improve performance of queries involving `IS NULL`, `IS NOT NULL` by pushing predicate
  computation to the underlying database. ({issue}`issuenumber`)
* Improve performance of queries involving `NOT`  by pushing expression
  computation to the underlying database. ({issue}`issuenumber`)

@cla-bot cla-bot bot added the cla-signed label Mar 16, 2022
@wendigo wendigo requested review from findepi and hashhar and removed request for findepi March 16, 2022 13:25
@wendigo wendigo requested a review from findepi March 16, 2022 13:27
@wendigo wendigo changed the title Pushdown NOT, IS NULL, NOT IS NULL in PostgreSQL connector Push down NOT, IS NULL, NOT IS NULL in PostgreSQL connector Mar 16, 2022
@findepi
Copy link
Copy Markdown
Member

findepi commented Mar 16, 2022

@wendigo can you please rebase on top of #11515 ?

@wendigo wendigo force-pushed the serafin/expression-pushdown-support branch from 5c9367b to c0bcdf7 Compare March 16, 2022 14:16
@wendigo
Copy link
Copy Markdown
Contributor Author

wendigo commented Mar 16, 2022

@findepi done

Copy link
Copy Markdown
Member

@findepi findepi left a comment

Choose a reason for hiding this comment

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

"Translate NOT, IS NULL, NOT IS NULL to connector expression(s)"

@wendigo wendigo force-pushed the serafin/expression-pushdown-support branch from b3eea04 to 74a07e5 Compare March 16, 2022 17:01
@wendigo wendigo requested a review from findepi March 16, 2022 17:02
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

stale comment?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's also test with a column that actually contains NULLs.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also IS NULL is possible to represent as a TupleDomain (none) so should we add an OR to ensure expression pushdown path?

@wendigo wendigo force-pushed the serafin/expression-pushdown-support branch 2 times, most recently from c03af14 to 2f7bf47 Compare March 21, 2022 11:29
Copy link
Copy Markdown
Member

@findepi findepi left a comment

Choose a reason for hiding this comment

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

"Translate NOT, IS NULL, NOT IS NULL to connector expression(s)"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

NotIsNull -> IsNotNull

Copy link
Copy Markdown
Member

@findepi findepi left a comment

Choose a reason for hiding this comment

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

"Implement NOT, IS NULL, NOT IS NULL pushdown in PostgreSQL connector"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

NOT (a OR b) can be replaced with (NOT a) AND (NOT b).

The test still would test what it tests, but having NOT around LIKE only would make it simpler.
Please change.

@findepi
Copy link
Copy Markdown
Member

findepi commented Mar 21, 2022

LGTM % comments.

@findepi findepi force-pushed the serafin/expression-pushdown-support branch from 2f7bf47 to 3a20817 Compare March 21, 2022 14:48
@findepi
Copy link
Copy Markdown
Member

findepi commented Mar 21, 2022

(applied myself)

@assaf2 assaf2 self-requested a review March 21, 2022 17:42
@findepi findepi merged commit 5e500ef into trinodb:master Mar 22, 2022
@github-actions github-actions bot added this to the 375 milestone Mar 22, 2022
@findepi findepi mentioned this pull request Mar 22, 2022
@wendigo wendigo deleted the serafin/expression-pushdown-support branch March 22, 2022 09:31
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.

4 participants