Re: indexes

From: Richard Huxton <dev(at)archonet(dot)com>
To: gearond(at)cvc(dot)net, pgsql-general(at)postgresql(dot)org
Subject: Re: indexes
Date: 2003-03-27 12:45:28
Message-ID: 200303271245.28067.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

  • Re: indexes at 2003-03-26 22:57:46 from Dennis Gearon

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2003-03-27 13:05:30 Re: Earth distance
Previous Message Richard Huxton 2003-03-27 12:43:35 Re: before/after triggers