Re: Planning of sub partitions

2024-07-05 Thread David Rowley
On Sat, 6 Jul 2024 at 03:24, Matt Hughes wrote: > -- 4. uses all partitions; should exclude event_closed_y2024_m02 > explain select * from event > where > cleared is false OR > (cleared is true and date_raised > '2024-01-01' AND date_raised < > '2024-01-02'); >

Re: Planning of sub partitions

2024-07-05 Thread Matt Hughes
One workaround seems to be using a CTE with a union: with openAndRecentlyRaisedEvents as ( select * from event where cleared is false union all select * from event where cleared is true and date_raised > '2024-01-01' AND date_raised < '2024-01-02'; ) select * from openAndREcentlyRaisedEven