Re: Are range_before and range_after commutator operators?

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Are range_before and range_after commutator operators?
Date: 2011-11-18 08:14:16
Message-ID: 1321604056.11794.30.camel@jdavis
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 2011-11-17 at 17:10 -0500, Tom Lane wrote:
> Applied, thanks. These comments aren't quite what I'd hoped for though.
> What I'm lacking is the conceptual context, ie, why is a
> less-equal-greater primitive for bounds a good thing? It seems like
> when you consider the four possible directional (lower/upper)
> combinations, the same result from range_cmp_bounds means something
> different in each case, and I find that confusing. I wonder whether
> functions defined along set-theoretic lines (this bound is strictly
> weaker or stronger than this other one, or these bounds together define
> an empty or singleton or non-singleton set) might be more transparent.

I think it comes down to how helpful it is to define higher-level
functions in terms of range_cmp_bounds versus some other function (or
set of functions).

range_cmp_bounds seemed to work out fairly well for most of the
operators, and it was the best that I came up with. The nice thing about
it is that it can compare a lower bound to another lower bound, or to an
upper bound. Then again, perhaps I tried to hard to unify those
concepts, and it just led to complexity?

I'm open to suggestion.

Regards,
Jeff Davis

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2011-11-18 08:25:24 range_adjacent and discrete ranges
Previous Message Etsuro Fujita 2011-11-18 07:25:55 Re: WIP: Collecting statistics on CSV file data