On 17 January 2018 at 05:49, Jeff Davis <pg...@j-davis.com> wrote: > On Wed, Jan 10, 2018 at 7:49 AM, Simon Riggs <si...@2ndquadrant.com> wrote: >> Do we optimize for TIMESTAMP <@ RANGE as well? > > Not currently. It requires a little extra complexity because empty > ranges will match anything and need special handling.
TIMESTAMP <@ RANGE is arguably more important than RANGE && RANGE Trying to cast timestamp to range to make that work is a bit hokey If the problem is just empty ranges, it seems like we should do that here also. I'd be happy with the optimization only working if ranges are provably non-empty, e.g. CHECK (NOT isempty(col)) Or perhaps we need non-empty types: e.g. tsrangene -- Simon Riggs http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services