opteryx
opteryx copied to clipboard
✨ `OR` to `UNION` optimizer strategy
rewrite queries with complex OR segments as UNIONed queries.
as a contrived example:
SELECT * FROM $planets WHERE (id = 1) OR (name = 'Earth')
can be written as
SELECT * FROM $planets WHERE id = 1
UNION
SELECT * FROM $planets WHERE name = 'Earth'
Removing the OR condition is more likely to result in predicates being pushed, although will cost having to read the datasets twice (which can be quite expensive)