X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id CE7E3D1B57C for ; Fri, 13 Feb 2004 13:56:55 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 93687-02 for ; Fri, 13 Feb 2004 09:56:57 -0400 (AST) Received: from tht.net (vista.tht.net [216.126.88.2]) by svr1.postgresql.org (Postfix) with ESMTP id 1E844D1B4E1 for ; Fri, 13 Feb 2004 09:56:53 -0400 (AST) Received: from [134.22.71.135] (dyn-71-135.tor.dsl.tht.net [134.22.71.135]) by tht.net (Postfix) with ESMTP id 26F7076C33; Fri, 13 Feb 2004 08:56:58 -0500 (EST) Subject: Re: 7.4 - FK constraint performance From: Rod Taylor To: Richard Huxton Cc: Tom Lane , ow , pgsql-sql@postgresql.org In-Reply-To: <200402130722.17663.dev@archonet.com> References: <20040213010341.95282.qmail@web60801.mail.yahoo.com> <1076640825.10896.12.camel@jester> <27443.1076646336@sss.pgh.pa.us> <200402130722.17663.dev@archonet.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-6wakewytllr5xrvydI03" Message-Id: <1076680640.10896.15.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Fri, 13 Feb 2004 08:57:20 -0500 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/156 X-Sequence-Number: 16847 --=-6wakewytllr5xrvydI03 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable > In this precise example, could you not: > 1. Check index for value > 2. If found, seq-scan >=20 > Of course that's only going to be a sensible thing to do if you're expect= ing=20 > one of two results: > 1. Value not there > 2. Lengthy seq-scan if it is there Most of the queries are going to be for the other values (in which case you've wasted an index scan) which is minor, but in the event there is a single 239 you're still taking a big hit. That is an awful lot of work to handle the non-existant case only. --=20 Rod Taylor Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL PGP Key: http://www.rbt.ca/rbtpub.asc --=-6wakewytllr5xrvydI03 Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQBALNe/6DETLow6vwwRAlEuAJ9T2x7UzWozBSMxv69LywTOJXVeEgCfV0O/ Dyt4J6aBXj6CkJHx+VORRTU= =1B6V -----END PGP SIGNATURE----- --=-6wakewytllr5xrvydI03--