Re: [despammed] question about index

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Andreas Kretschmer <akretschmer(at)despammed(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: [despammed] question about index
Date: 2004-12-16 14:10:25
Message-ID: 20041216141025.GC2768@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Thu, Dec 16, 2004 at 12:01:39 +0100,
Andreas Kretschmer <akretschmer(at)despammed(dot)com> wrote:
> >
> > considering that almost 70% of the rows will be with 'VALUE1', 20%
> > will be with 'VALUE2' and 10% will be with 'VALUE3' on the average.
> >
> > should I create an index to speedup the counts or not ?
>
> Yes.

Indexes will probably not help in this case. Even when looking at 10% of
the rows, a sequential scan is still going to be faster than an index
scan in most cases.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Andreas Kretschmer 2004-12-16 14:15:57 Re: [despammed] question about index
Previous Message Roberto Fichera 2004-12-16 11:41:22 Re: Query aid