Re: indexes

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: indexes
Дата
Msg-id 200303271245.28067.dev@archonet.com
обсуждение исходный текст
Ответ на Re: indexes  (Dennis Gearon <gearond@cvc.net>)
Список pgsql-general
On Wednesday 26 Mar 2003 10:57 pm, Dennis Gearon wrote:
> The right hand little finger on the carriager return is quicker than my
> brain. I will now FINISH my question :-)
>
> ----------------------------------------------------
> Would a unique index, or a trigger doing a:
>
> IF ( SELECT COUNT(*) where _index_condition_ ) THEN
>      CRY MOMMA and GO HOME.
>
> be faster?

SELECT COUNT(*) will always do a sequential scan (at the moment and for the
immediate future versions AFAIK). Unless the table is small, a unique index
seems the best.

--
  Richard Huxton


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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: before/after triggers
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: Earth distance