optd icon indicating copy to clipboard operation
optd copied to clipboard

Feat: heuristic rule might result in already generated expr making expr replacement tricky

Open AveryQi115 opened this issue 11 months ago • 0 comments

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:

  1. 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)
  2. add a flag to mark the expr is a dead end

Test Guidance

It happens in two scenarios:

  1. the generated expr by heuristic rule already exist in another group
  2. 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.

AveryQi115 avatar Mar 11 '24 06:03 AveryQi115