Re: ToDo: KNN Search should to support DISTINCT clasuse?

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: ToDo: KNN Search should to support DISTINCT clasuse?
Дата
Msg-id CAM-w4HO9TakKStXT6xtCqrECmo+5G4PAurK0cvQ+4fpw37WPeQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: ToDo: KNN Search should to support DISTINCT clasuse?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: ToDo: KNN Search should to support DISTINCT clasuse?
Список pgsql-hackers
On Mon, Oct 22, 2012 at 4:57 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Don't hold your breath.  There are two ways the system could implement
> the DISTINCT clause: either sort and uniq, or hashaggregate.
> hashaggregate will destroy any input ordering, so there's no value in
> using the index as input.  sort and uniq requires the input to be sorted
> by *all* the columns being distinct'ed, not just one, so again this
> index isn't useful.

We already have some bits that understand functional dependencies for
distinct/group by don't we? Do we detect that col <-> 'foo' is
functionally dependent on col? If so is it possible to construct a
multicolumn index that can produce an ordering like [col <-> 'foo',
col] which could be used to get distinct values of col in the knn
order (since the first column is functionally dependent on the second
it can be ignored for grouping purposes).

Not that we can do this now but I wonder whether a lot of the pieces
are already there and just need to be hooked up together.


-- 
greg



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

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: Successor of MD5 authentication, let's use SCRAM
Следующее
От: "David Johnston"
Дата:
Сообщение: Re: Deprecating RULES