Re: Does anybody use ORDER BY x USING y?

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: Does anybody use ORDER BY x USING y?
Дата
Msg-id 87br2pozbi.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на Re: Does anybody use ORDER BY x USING y?  (Martijn van Oosterhout <kleptog@svana.org>)
Ответы Re: Does anybody use ORDER BY x USING y?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Martijn van Oosterhout <kleptog@svana.org> writes:

> On Sun, Sep 18, 2005 at 11:23:01PM -0400, Tom Lane wrote:
> <snip>
> > class families" to relate opclasses for different datatypes.  Basically
> > I'd like to solve most of these issues by constructing a new layer atop
> > opclasses, not by deciding that an opclass doesn't convey the full story
> > about the behavior of an index column.

The thing is that these opclasses you're describing are closely related. It
ought to be possible to use a single index to produce results in any of the
four orders you describe.

> Where I'm currently going is creating a table of COLLATE orders. These
> collate orders would refer to operator classes but "tweak" them. For
> example, things like:
> 
> - Sort ascending or descending (descending reverses the bt*cmp test)
> - NULLs first or last
> - Locale for text types
> - etc

These aren't all related in the same way. While it obviously isn't hard to
produce results ascending or descending, and it shouldn't be hard to produce
NULLs first or last regardless of where they appear in the index, it would be
utterly impossible to use an index built with the wrong locale collation.

-- 
greg



В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Magnus Hagander"
Дата:
Сообщение: Re: Beta2 Wrap Up ...
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Does anybody use ORDER BY x USING y?