Re: [GENERAL] "Hash index" vs. "b-tree index" (PostgreSQL
| От | Tom Lane |
|---|---|
| Тема | Re: [GENERAL] "Hash index" vs. "b-tree index" (PostgreSQL |
| Дата | |
| Msg-id | 25690.1115754605@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: [GENERAL] "Hash index" vs. "b-tree index" (PostgreSQL (Greg Stark <gsstark@mit.edu>) |
| Ответы |
Re: [GENERAL] "Hash index" vs. "b-tree index" (PostgreSQL
|
| Список | pgsql-performance |
Greg Stark <gsstark@mit.edu> writes:
>>> What if the hash index stored *only* the hash code? That could be useful for
>>> indexing large datatypes that would otherwise create large indexes.
>>
>> Hmm, that could be a thought.
> Hm, if you go this route of having hash indexes store tuples ordered by hash
> code and storing the hash code in the index, then it seems hash indexes become
> just a macro for a btree index of HASH(index columns).
No, not at all, because searching such an index will require a tree
descent, thus negating the one true advantage of hash indexes. I see
the potential value of sorting by hashcode within an individual page,
but that doesn't mean we should do the same across the whole index.
regards, tom lane
В списке pgsql-performance по дате отправления: