-
Notifications
You must be signed in to change notification settings - Fork 467
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
[optimize] MRE::typ(): can we avoid recalculating types? #30871
base: main
Are you sure you want to change the base?
Conversation
Short answer: no. Recalculating the types gives us more precise keys.
Trying one more run, this time just using the |
fce5acb
to
0779168
Compare
"keys": [ | ||
[] | ||
] | ||
"keys": [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's surprising that the key was wrong in the MirRelationExpr::Constant
from which as_const
got the type. We might want to investigate this (maybe independently from this PR).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, could you rebase on top of #30881?
I have a theory on what might have happened: take_safely
used to not set the best possible key, because it ran the key derivation on the original thing, where the key derivation often has no chance to realize that it's an empty relation (because the caller of take_safely
might have determined this in complex ways). If this doesn't change after the rebase, then there are other places where we don't accurately set the keys on constants.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In #30894.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebase is green... which means that we're still getting the less precise types on constants, right? 🤔
Part of
MirRelationExpr::typ()
cleanup.Is it possible to avoid recalculating types?
Motivation
https://github.com/MaterializeInc/database-issues/issues/2488
https://github.com/MaterializeInc/database-issues/issues/3779
https://github.com/MaterializeInc/database-issues/issues/4959
Tips for reviewer
Checklist
$T ⇔ Proto$T
mapping (possibly in a backwards-incompatible way), then it is tagged with aT-proto
label.