optd
optd copied to clipboard
Feat: heuristic rule might result in already generated expr making expr replacement tricky
Context
https://github.com/cmu-db/optd/pull/88
Current Design
When the generated expr by heuristic rule already exist in another group, we merge two groups and mark the old expr as a dead end (mark all rules have been fired for it.) It might be costly.
And here are several alternatives:
- remove the old expr, but keep the group so that its parent can still find it. (might lead to an empty group without expr, might cause future problems)
- add a flag to mark the expr is a dead end
Test Guidance
It happens in two scenarios:
- the generated expr by heuristic rule already exist in another group
- the generated expr is a placeholder type containg a new group id
With small number of rules, the first scenario is quite rare. The feat might be improved and tested with more rules in the future.