Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux