cmu-db / optd

CMU-DB's Cascades optimizer framework
https://cmu-db.github.io/optd/
MIT License
383 stars 22 forks source link

refactor(repr): empty relation has child, add values node #207

Closed skyzh closed 3 weeks ago

skyzh commented 1 month ago

Empty relation now has a child, this makes it easier to infer logical properties of the node. We don't need to store anything (i.e., schema) in empty relation. Simply wrap the original plan node with empty relation and it's done. (TBD: rename to blackhole node? and remove OneRow variant b/c it's covered by the values node)

Also added values plan node. Currently, this is only used to represent a leaf node that produces nothing.

The difference between values node and empty relation: schema inference. Empty relation passes through all logical properties from the child node (i.e., schema), while values node have its own schema based on the first row of the value (not implemented yet)

skyzh commented 4 weeks ago

let's hold this patch and discuss it later, I'm also unsure about how to represent such empty thing either as a property or as a plan node