X-Original-To: pgsql-performance@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id C6149475E82 for ; Sat, 29 Mar 2003 11:59:08 -0500 (EST) Received: from smtp.inode.at (smtp-04.inode.at [62.99.194.6]) by postgresql.org (Postfix) with ESMTP id 2C2C9475AE5 for ; Sat, 29 Mar 2003 11:59:08 -0500 (EST) Received: from line-c-227.adsl-dynamic.inode.at ([62.99.151.227]:35423 helo=andi-lap) by smtp.inode.at with smtp (Exim 4.10) id 18zJfg-0005IZ-00; Sat, 29 Mar 2003 17:59:09 +0100 Received: by andi-lap (sSMTP sendmail emulation); Sat, 29 Mar 2003 17:59:11 +0100 Subject: Re: Index not used, performance problem From: Andreas Kostyrka To: Christopher Kings-Lynne Cc: pgsql-performance@postgresql.org In-Reply-To: <20030329214139.N4697-100000@houston.familyhealth.com.au> References: <20030329214139.N4697-100000@houston.familyhealth.com.au> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-doEA5B4TdHHZUNvSCiXQ" Organization: Message-Id: <1048957151.7543.19.camel@andi-lap> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 29 Mar 2003 17:59:11 +0100 X-Spam-Status: No, hits=-44.3 required=5.0 tests=BAYES_10,EMAIL_ATTRIBUTION,IN_REP_TO,PGP_SIGNATURE_2, QUOTED_EMAIL_TEXT,REFERENCES,REPLY_WITH_QUOTES, USER_AGENT_XIMIAN autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200303/194 X-Sequence-Number: 1492 --=-doEA5B4TdHHZUNvSCiXQ Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Sat, 2003-03-29 at 14:47, Christopher Kings-Lynne wrote: > Hi Andreas, >=20 > A few points: >=20 > 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 --=-doEA5B4TdHHZUNvSCiXQ Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQA+hdDfHJdudm4KnO0RAjstAJ0dJmy+cpD4fHR58w8/C7mbuivo2ACeLzWl TCYdzdyza1fmtg3vN+sY4Qw= =EHBI -----END PGP SIGNATURE----- --=-doEA5B4TdHHZUNvSCiXQ--