Would it be possible to utilize a GIN index to query for distinct values ?

Поиск
Список
Период
Сортировка
От Danny Shemesh
Тема Would it be possible to utilize a GIN index to query for distinct values ?
Дата
Msg-id CAFZC=QojumgqutQBO_v3JT3Vqbr86O0L8ZtSzQvT79tVfqzLgg@mail.gmail.com
обсуждение исходный текст
Список pgsql-general
Hey everyone !

Bumping an older thread, I've read the GIN readme in the code base and have skimmed through the implementation, it made me wonder -
would it be possible to use the index to query for distinct / count distinct values, at least for some key types ?

For instance, say I have a GIN index on a single, highly cardinal but non-unique text column (a-la 'name'); from my very limited understanding, would it be possible to query for distinct / count distinct values via roughly:
- Traversing the GIN entry tree tuples
- Gathering the key data from said tuples
- Discarding keys with no / empty posting lists, as they aren't discarded from the tree
- Traversing the pending list for indices with fastupdate & merging the result set

I'm probably off by quite a lot, but I'd really appreciate your great insight on the above.

Thanks !
Danny

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

Предыдущее
От: Durumdara
Дата:
Сообщение: Re: Can I start Update row in After Insert trigger function?
Следующее
От: operations i
Дата:
Сообщение: Fwd: How is this possible "publication does not exist"