From: John A Meinel <john@arbash-meinel.com>
To: Manfred Koizar <mkoi-pg@aon.at>
To: Postgresql Performance <pgsql-performance@postgresql.org>
Subject: Re: Insert performance (OT?)
Date: Wed, 17 Aug 2005 17:02:28 -0500
Message-ID: <4303B3F4.9010306@arbash-meinel.com> (raw)
In-Reply-To: <cs67g11p5k1pfkf6kcuvpnjubmmeutcni2@4ax.com>
References: <b201f08ef88897bc4ad87631fda3d877@implements.be>
<42DCCA3B.8070100@archonet.com>
<d1bd55e89dc5018ddbf7ff09e78d9c61@implements.be>
<42DCDB47.3060009@archonet.com>
<cs67g11p5k1pfkf6kcuvpnjubmmeutcni2@4ax.com>
Manfred Koizar wrote:
> On Tue, 19 Jul 2005 11:51:51 +0100, Richard Huxton <dev@archonet.com>
> 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
>
Attachments:
signature.asc (application/pgp-signature, 252B) 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 using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: john@arbash-meinel.com, mkoi-pg@aon.at
Subject: Re: Insert performance (OT?)
In-Reply-To: <4303B3F4.9010306@arbash-meinel.com>
* 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