Re: Hash Indexes

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Hash Indexes
Дата
Msg-id 20080107161608.GB12212@svana.org
обсуждение исходный текст
Ответ на Re: Hash Indexes  (Naz Gassiep <naz@mira.net>)
Список pgsql-general
On Tue, Jan 08, 2008 at 01:49:53AM +1100, Naz Gassiep wrote:
> I would assume that hash indexes have inbuilt mechanisms for collision
> checking before returning the row as a match. Am I correct in this
> assumption?

Well, they do in the sense that it does the equivalent of:

SELECT * FROM table WHERE md5(textcol) = md5('text') and textcol = 'text';

But hash indexes can't be used for uniqueness checks, so if you need to
stop the same value being entered twice, hash indexes are way out.

The fact that hash indexes don't survive a DB crash is probably your
biggest concern.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Those who make peaceful revolution impossible will make violent revolution inevitable.
>  -- John F Kennedy

Вложения

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

Предыдущее
От: Andrew Sullivan
Дата:
Сообщение: Re: Hash Indexes
Следующее
От: Sam Mason
Дата:
Сообщение: Re: Hash Indexes