From: Andreas Kostyrka <andreas@mtg.co.at>
To: Christopher Kings-Lynne <chriskl@familyhealth.com.au>
Cc: pgsql-performance@postgresql.org
Subject: Re: Index not used, performance problem
Date: 29 Mar 2003 17:59:11 +0100
Message-ID: <1048957151.7543.19.camel@andi-lap> (raw)
In-Reply-To: <20030329214139.N4697-100000@houston.familyhealth.com.au>
References: <20030329214139.N4697-100000@houston.familyhealth.com.au>
On Sat, 2003-03-29 at 14:47, Christopher Kings-Lynne wrote:
> Hi Andreas,
>
> A few points:
>
> PostgreSQL is rarely going to use an index for a boolean column. The
> reason is that since almost by definition true will occupy 50% of the rows
> and false will occupy 50% (say). In this case, a sequential scan is
> always faster. You would say that the 'selectivity' isn't good enough.
Well, perhaps it should collect statistics, because a "deleted" column
is a prime candidate for a strongly skewed population.
Andreas
Attachments:
signature.asc (application/pgp-signature, 188B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: andreas@mtg.co.at, chriskl@familyhealth.com.au
Subject: Re: Index not used, performance problem
In-Reply-To: <1048957151.7543.19.camel@andi-lap>
References: <20030329214139.N4697-100000@houston.familyhealth.com.au> <1048957151.7543.19.camel@andi-lap>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox