Skip to content

Add additional tests for PostgreSQL automatic JOIN pushdown#11703

Merged
findepi merged 4 commits intotrinodb:masterfrom
findepi:findepi/join-pushdown-tests
Mar 31, 2022
Merged

Add additional tests for PostgreSQL automatic JOIN pushdown#11703
findepi merged 4 commits intotrinodb:masterfrom
findepi:findepi/join-pushdown-tests

Conversation

@findepi
Copy link
Copy Markdown
Member

@findepi findepi commented Mar 29, 2022

No description provided.

@findepi findepi added test no-release-notes This pull request does not require release notes entry labels Mar 29, 2022
@cla-bot cla-bot bot added the cla-signed label Mar 29, 2022
Co-authored-by: Ashhar Hasan <ashhar.hasan@starburstdata.com>
Co-authored-by: Łukasz Osipiuk <lukasz@osipiuk.net>
Co-authored-by: Jan Was <jan.was@starburstdata.com>
Co-authored-by: Piotr Findeisen <piotr.findeisen@gmail.com>
@findepi findepi force-pushed the findepi/join-pushdown-tests branch from d5585b7 to db0b40a Compare March 29, 2022 09:19
Co-authored-by: Łukasz Osipiuk <lukasz@osipiuk.net>
@findepi
Copy link
Copy Markdown
Member Author

findepi commented Mar 29, 2022

cc @findinpath

// allowed join_to_tables ratio is 1.25 and join size is 54_000 which is less than (54_000 + 9_000) * 1.25 == 78_750 and is pushed down
assertThat(query(session, smallJoinOutputQuery)).isFullyPushedDown();

// if we move threshold lower it will not be pushed down any more
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: anymore

"INNER JOIN tpch.tiny.orders o ON c.custkey = o.custkey";

PlanMatchPattern joinWithoutFilter =
anyTree(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

newbie question: How should I read this plan?

customer & nation get joined and their outcome gets joined with orders?

I'd be happy to have a few comments explaining what triggers the reordering of the join operations.

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.

For join re-ordering logic see ReorderJoins. This test however doesn't care how joins get re-ordered. It just cares that for a known-suboptimal order joins get reordered even if there's possibility of join pushdown. i.e. we shouldn't eagerly pushdown things because it's possible join re-ordering will lead to better plan overall.

@findepi findepi merged commit 557278b into trinodb:master Mar 31, 2022
@findepi findepi deleted the findepi/join-pushdown-tests branch March 31, 2022 10:05
@github-actions github-actions bot added this to the 376 milestone Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed no-release-notes This pull request does not require release notes entry test

Development

Successfully merging this pull request may close these issues.

6 participants