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

make sure to handle subqueries on top of subqueries #7730

Merged
merged 2 commits into from
Mar 25, 2021

Conversation

systay
Copy link
Collaborator

@systay systay commented Mar 23, 2021

Description

Planning subqueries on top of subqueries was not working as expected. We broke planning of this with the 9.0 release. This is to fix this regression.

Related Issue(s)

#7682

Checklist

  • Should this PR be backported? Yes, to the release-9.0 branch
  • Tests were added or are not required Added
  • Documentation was added or is not required

Impacted Areas in Vitess

Components that this PR will affect:

  • Query Serving

Signed-off-by: Andres Taylor <andres@planetscale.com>
Comment on lines +169 to +174
select id from user where not id in (select col from music where music.user_id = 42) and id in (select col from music where music.user_id = 411)

1 ks_sharded/40-80: select col from music where music.user_id = 42 limit 10001
2 ks_sharded/40-80: select col from music where music.user_id = 411 limit 10001

----------------------------------------------------------------------
Copy link
Member

Choose a reason for hiding this comment

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

this does not tell what happened to the main query, where it is executed.
I have less knowledge here. so cc: @aquarapid

Copy link
Contributor

Choose a reason for hiding this comment

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

It's not ideal, but acceptable; maybe make a note as a cleanup/enhancement item to add visibility of the top-level query?

Copy link
Member

@harshit-gangal harshit-gangal left a comment

Choose a reason for hiding this comment

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

Overall looks good. Hence approving it.

Signed-off-by: Andres Taylor <andres@planetscale.com>
@systay systay merged commit ff618a2 into vitessio:master Mar 25, 2021
@systay systay deleted the subquery-w-subquery branch March 25, 2021 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants