On Tue, Jan 23, 2018 at 2:04 AM, Simon Riggs <si...@2ndquadrant.com> wrote: > Perhaps we are misunderstanding each other > > TIMESTAMP <@ RANGE1 doesn't match if RANGE1 is empty > and that is the most important case
When <@ is supported, that case should be fine if range1 is on the outer. The case I was concerned about is with a R1 <@ R2 join where R1 is on the inner side and could have empty ranges. One option would be to try to force R2 to be on the inner. But that doesn't quite solve other related issues, like if R2 has a few large ranges that contain almost everything. Right now I'm considering an approach where we use some counters to determine that a few ranges are preventing us from moving the mark forward, and then move those few ranges into a separate tuplestore so that we can move the mark forward. > RANGE OP RANGE is important also. It would be useful for OP to be more > than just && I agree that contains/contained-by are useful; do you have other operators in mind as well? > > It's certainly weird that R1 @> EMPTY is true, but R1 && EMPTY is not. This was discussed back in 9.2, and there were no obviously better semantics available. I chose to follow set semantics: X contains Y means that Y is a subset of X; X overlaps Y means that the intersection of X and Y is nonempty. I understand it can be surprising, but other definitions can be surprising, too. Regards, Jeff Davis