From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Bruno Wolff III <bruno(at)wolff(dot)to> |
Cc: | Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: index suggestion for 7.4 |
Date: | 2003-05-30 19:54:52 |
Message-ID: | 12533.1054324492@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Bruno Wolff III <bruno(at)wolff(dot)to> writes:
> I went back and reread the stuff on NEGATOR and found it only applies
> to operators that return boolean types. I had thought it was different
> and would let you make the deduction a > b <=> -a <= -b, but that isn't
> the case. Instead it lets you make the deduction that a > b <=> NOT (a <= b).
Right, the reason NEGATOR exists is to let prepqual.c flatten out NOTs
where possible (this is the same part of the code that applies
DeMorgan's Laws and other boolean algebra to try to bring a qual
condition into the simplest possible form).
To do something useful with "-" and descending order, we'd need some way
of explicitly associating "-" operators with btree opclasses. I'm not
convinced that it's worth the trouble, especially when it'd really only
apply to the numeric datatypes ("-" on text is a pretty unappealing
concept...). Stephan's suggestion of providing standard reverse-order
opclasses seems more attractive to me. Even if people didn't want to
put them into the mainstream, they could be consed up as a contrib
module with not a lot of effort.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Sean Chittenden | 2003-05-30 20:20:28 | Re: XML ouput for psql |
Previous Message | Tom Lane | 2003-05-30 19:42:29 | Re: is it possible to enlarge the TopMemoryContext? |