X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 169F35285B for ; Wed, 17 Aug 2005 19:02:42 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 84472-09 for ; Wed, 17 Aug 2005 22:02:38 +0000 (GMT) Received: from sccmmhc91.asp.att.net (sccmmhc91.asp.att.net [204.127.203.211]) by svr1.postgresql.org (Postfix) with ESMTP id 04BC452B37 for ; Wed, 17 Aug 2005 19:02:34 -0300 (ADT) Received: from juju.arbash-meinel.com ([12.214.18.81]) by sccmmhc91.asp.att.net (sccmmhc91) with ESMTP id <20050817220235m9100g6hbue>; Wed, 17 Aug 2005 22:02:35 +0000 Received: by juju.arbash-meinel.com (Postfix, from userid 505) id 2133B55FBA; Wed, 17 Aug 2005 17:02:35 -0500 (CDT) Received: from [192.168.1.12] (Jigglypuff.arbash-meinel.com [192.168.1.12]) by juju.arbash-meinel.com (Postfix) with ESMTP id 55F1C55FAD; Wed, 17 Aug 2005 17:02:28 -0500 (CDT) Message-ID: <4303B3F4.9010306@arbash-meinel.com> Date: Wed, 17 Aug 2005 17:02:28 -0500 From: John A Meinel User-Agent: Mozilla Thunderbird 1.0.6 (Macintosh/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Manfred Koizar , Postgresql Performance Subject: Re: Insert performance (OT?) References: <42DCCA3B.8070100@archonet.com> <42DCDB47.3060009@archonet.com> In-Reply-To: X-Enigmail-Version: 0.92.0.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig314C86187A1349552BC0B1FC" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.043 required=5 tests=[AWL=-0.007, FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200508/217 X-Sequence-Number: 13964 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig314C86187A1349552BC0B1FC Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Manfred Koizar wrote: > On Tue, 19 Jul 2005 11:51:51 +0100, Richard Huxton > wrote: > >>You could get away with one query if you converted them to left-joins: >>INSERT INTO ... >>SELECT * FROM upload LEFT JOIN ... WHERE f3 IS NULL >>UNION >>SELECT * FROM upload LEFT JOIN ... WHERE f4 IS NULL > > > For the archives: This won't work. Each of the two SELECTs > eliminates rows violating one of the two constraints but includes rows > violating the other constraint. After the UNION you are back to > violating both constraints :-( Couldn't you use "INTERSECT" then? To only get the rows that *both* queries return? John =:-> > > Servus > Manfred > > > ---------------------------(end of broadcast)--------------------------- > TIP 5: don't forget to increase your free space map settings > --------------enig314C86187A1349552BC0B1FC Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFDA7P0JdeBCYSNAAMRAjhsAJ9pCTOStHkdEkOEV4uwj2RSuZm4+QCffk+7 Y6mRPRvjR4RKPGu4R8sg/GY= =F/S/ -----END PGP SIGNATURE----- --------------enig314C86187A1349552BC0B1FC--