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 join table reference check in JOIN ON clause #17333

Conversation

rmarduga
Copy link
Contributor

@rmarduga rmarduga commented Feb 22, 2022

While it is permitted to omit the reference of the joining table in a conditional join, the result of such join can lead to a cross join with filter, which can harm the query execution performance. Often, such queries are just a result of copy and paste from another join when user updated the joining table name but forgot to update the join condition.

This change will show the PERFORMANCE_WARNING to the user in cases when JOIN ON clause misses the comparison expression with joining table and other table.

== NO RELEASE NOTE ==

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Feb 22, 2022

CLA Signed

The committers are authorized under a signed CLA.

  • ✅ Ruslan Mardugalliamov (6649d94c905415b48e2e269dc03f82f125722051)

@jainxrohit
Copy link
Contributor

Can you please submit a CLA a support request?
https://jira.linuxfoundation.org/servicedesk/customer/portal/4

@jainxrohit
Copy link
Contributor

@rmarduga Can you please squash both commits to a single commit?

@rmarduga rmarduga force-pushed the Add_join_table_reference_check_in_JOIN_ON_clause branch 4 times, most recently from 8bf1d9b to 6649d94 Compare February 24, 2022 21:41
@jainxrohit
Copy link
Contributor

le it is permitted to omit the reference of the joining table in a conditional join, the result of such join can lead to a cross join with filter, which can harm the query execution performance. Often, such queries are just a result of copy and paste from another join when user updated the joining table name but forgot to update the join condition.

This change will show the PERFORMANCE_WARNING to the user in cases when JOIN ON clause misses the comparison expression with joining table and other table.

Test plan - mvn clean install -DskipTests -T1C

You can get rid of line break in the PR description. No need for
"Test plan - mvn clean install -DskipTests -T1C"

@rmarduga rmarduga force-pushed the Add_join_table_reference_check_in_JOIN_ON_clause branch from 6649d94 to 750d9eb Compare February 24, 2022 22:27
@rmarduga rmarduga force-pushed the Add_join_table_reference_check_in_JOIN_ON_clause branch 3 times, most recently from 162325e to 39883e4 Compare February 25, 2022 22:50
@rmarduga rmarduga force-pushed the Add_join_table_reference_check_in_JOIN_ON_clause branch from 39883e4 to a971f5c Compare February 26, 2022 16:12
@highker highker self-assigned this Mar 2, 2022
@rmarduga rmarduga force-pushed the Add_join_table_reference_check_in_JOIN_ON_clause branch 2 times, most recently from a833455 to 511b6eb Compare March 2, 2022 20:52
While it is permitted to omit the reference of the joining table in a
conditional join, the result of such join can lead to a cross join with
filter, which can harm the query execution performance. Often, such
queries are just a result of copy and paste from another join when
user updated the joining table name but forgot to update the join
condition.

This change will show the PERFORMANCE_WARNING to the user in cases
when JOIN ON clause misses the comparison expression with joining
table and other table.
@rmarduga rmarduga force-pushed the Add_join_table_reference_check_in_JOIN_ON_clause branch from 511b6eb to a341ccc Compare March 2, 2022 21:10
@highker highker merged commit 241adf1 into prestodb:master Mar 3, 2022
@rmarduga rmarduga deleted the Add_join_table_reference_check_in_JOIN_ON_clause branch March 10, 2022 20:09
rmarduga pushed a commit to rmarduga/presto that referenced this pull request Mar 11, 2022
Often times, while specifying the joining condition in JOIN ON clause,
users make mistakes and not referencing the joining table along side
with other table in join condition that result in performance issue due
to conditional join resulting in CROSS JOIN.

This change will extend the number of cases when user is shown the
PERFORMANCE_WARNING when JOIN ON clause misses the comparison expression
with joining table and other table. Specifically, it covers the cases
when  user does not explicitly refer to the relation through table name
or alias in JOIN ON clause.

Resolves:prestodb#17382
See also: prestodb#17333
highker pushed a commit that referenced this pull request Mar 11, 2022
Often times, while specifying the joining condition in JOIN ON clause,
users make mistakes and not referencing the joining table along side
with other table in join condition that result in performance issue due
to conditional join resulting in CROSS JOIN.

This change will extend the number of cases when user is shown the
PERFORMANCE_WARNING when JOIN ON clause misses the comparison expression
with joining table and other table. Specifically, it covers the cases
when  user does not explicitly refer to the relation through table name
or alias in JOIN ON clause.

Resolves:#17382
See also: #17333
rmarduga pushed a commit to rmarduga/presto that referenced this pull request Jul 19, 2022
Often times, while specifying the joining condition in JOIN ON clause,
users make mistakes and not referencing the joining table along side
with other table in join condition that result in performance issue due
to conditional join resulting in CROSS JOIN.

This change will reduce the number of cases when user is shown the
PERFORMANCE_WARNING when JOIN ON clause is actually correct.

See also: prestodb#17333, prestodb#17640
highker pushed a commit that referenced this pull request Jul 19, 2022
Often times, while specifying the joining condition in JOIN ON clause,
users make mistakes and not referencing the joining table along side
with other table in join condition that result in performance issue due
to conditional join resulting in CROSS JOIN.

This change will reduce the number of cases when user is shown the
PERFORMANCE_WARNING when JOIN ON clause is actually correct.

See also: #17333, #17640
shrinidhijoshi pushed a commit to shrinidhijoshi/presto that referenced this pull request Sep 7, 2022
Often times, while specifying the joining condition in JOIN ON clause,
users make mistakes and not referencing the joining table along side
with other table in join condition that result in performance issue due
to conditional join resulting in CROSS JOIN.

This change will reduce the number of cases when user is shown the
PERFORMANCE_WARNING when JOIN ON clause is actually correct.

See also: prestodb#17333, prestodb#17640
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.

4 participants