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 partial Top-N pushdown support for Vertica #24217

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vlad-lyutenko
Copy link
Contributor

@vlad-lyutenko vlad-lyutenko commented Nov 21, 2024

Description

Vertica doesn't have concept of NULLS FIRST/LAST for ORDER BY queries,
according to documentation:

NULL values are either first or last in the sort order, depending on data type:
INTEGER, INT, DATE/TIME: NULL has the smallest value.

FLOAT, BOOLEAN, CHAR, VARCHAR, ARRAY, SET: NULL has the largest value

So in case if trino hints to null ordering consistent with above rule we can do push down.

But if user for example has relaxed requirements for NULL's values or even know exactly that data is NULL free,
he could tweak the query to perform push down by making it consistent with Trino

for example by providing for

  • int, date/time columns - always ASC with NULLS_FIRST and DESC with NULLS_LAST
  • varchar/char/real columns - always ASC with NULLS_LAST and DESC with NULLS_FIRST

In this case pushdown will always happen.

Additional context and related issues

Release notes

( ) This is not user-visible or is docs only, and no release notes are required.
(x) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:

## Vertica connector
* Add support for partial Top-N pushdown. ({issue}`24217`)

@mosabua
Copy link
Member

mosabua commented Nov 21, 2024

Can you add a Performance section like in the PostgreSQL connector docs to the Vertica doc .. and for now just have the Top-N pushdown link.. and then over time we add more and more...

@mosabua mosabua requested a review from ebyhr November 21, 2024 19:49
@ebyhr ebyhr requested review from wendigo and hashhar and removed request for mosabua November 21, 2024 22:47
@vlad-lyutenko vlad-lyutenko force-pushed the vlad-lyutenko/vertica-topn-pushdown branch from 6c368fc to 68fea14 Compare November 25, 2024 11:25
@vlad-lyutenko vlad-lyutenko force-pushed the vlad-lyutenko/vertica-topn-pushdown branch from 68fea14 to 873a264 Compare November 25, 2024 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants