Re: index suggestion for 7.4
От | Tom Lane |
---|---|
Тема | Re: index suggestion for 7.4 |
Дата | |
Msg-id | 12533.1054324492@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: index suggestion for 7.4 (Bruno Wolff III <bruno@wolff.to>) |
Список | pgsql-hackers |
Bruno Wolff III <bruno@wolff.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
В списке pgsql-hackers по дате отправления: