-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
sql: a crash with a lookup join #40562
Comments
More accurately it's a crash in explain, right?
It fails on the last line here:
Which says to me that a column in |
It will also crash without explain, on distsql physical planning step. |
Debugger says that |
It sounds like this is an optimizer or execbuilder bug then, if we're getting malformed planNodes. |
Yeah, maybe. I wasn't sure about that, so I assigned it to Solon for triage. |
I think that this is a release blocker, so I'm adding it to #40447. |
Explain(opt):
Verbose:
|
I tried to investigate this but I got kind of lost figuring out where in the chain the optimizer got confused. It seems like the execbuilder is faithfully doing what the optimizer tells it to, which results in an index that doesn't match the input columns. So I'm going to hand this off to @RaduBerinde's team to take a look. |
If you comment out the
Thanks to @rytaft for volunteering to take this one on |
40583: sqlmigrations: remove ensureMaxPrivileges migration r=mberhault a=ajwerner This migration has baked. Furthermore it uses table descriptors in ways I'm working to change and I want to see it gone. Release note: None 40669: opt: fix execbuilder output column count for lookup joins r=rytaft a=rytaft This commit fixes a bug in the `execbuilder`, which was determining the number of output columns incorrectly for lookup joins. In particular, if the join was a semi- or anti-join, the `execbuilder` was incorrectly including the right side columns in the column count. This commit fixes the code so it only includes left side columns for semi- and anti-joins. This commit also fixes a bug in the DistSQL planner that was masked by the bug in the `execbuilder`. In particular, the output types slice for lookup semi- and anti-joins incorrectly included the types from the right side columns. This commit fixes it to only include types for the left side columns. Fixes #40562 Release note (bug fix): Fixed an error that could occur when the optimizer created a plan with a lookup semi- or anti-join nested inside of another join. Co-authored-by: Andrew Werner <[email protected]> Co-authored-by: Rebecca Taft <[email protected]>
I slightly modified query 21 of TPCH benchmark, and it crashed the server with:
Here is the modified query:
(I simply removed
AND l3.l_suppkey != l1.l_suppkey
condition from withinNOT EXISTS
subquery.)The text was updated successfully, but these errors were encountered: