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

No parallelism for children of ordered distinct #1864

Merged
merged 2 commits into from Jul 5, 2023

Conversation

max-hoffman
Copy link
Contributor

@max-hoffman max-hoffman commented Jul 5, 2023

We permitted parallelism into an OrderedDistinct node, which is a specialized Distinct node that expects results sorted on a specific index key. This change prevents parallelizing children of OrderedDistinct.

Copy link
Member

@zachmu zachmu left a comment

Choose a reason for hiding this comment

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

LGTM

if !isParallelizable(c.Node) {
foundOrderedDistinct := false
newNode, same, err := transform.NodeWithCtx(node, nil, func(c transform.Context) (sql.Node, transform.TreeIdentity, error) {
if _, ok := c.Node.(*plan.OrderedDistinct); ok {
Copy link
Member

Choose a reason for hiding this comment

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

Can't this go in isParallelizable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's what i tried first, but we check bottom-up. Nested children are still parallelized there.

@max-hoffman max-hoffman merged commit 51a311d into main Jul 5, 2023
6 checks passed
@max-hoffman max-hoffman deleted the max/ordered-distinct-parallelism branch July 6, 2023 00:05
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.

None yet

2 participants