Re: Insert performance (OT?)

From: Manfred Koizar <mkoi-pg(at)aon(dot)at>
To: Richard Huxton <dev(at)archonet(dot)com>
Cc: Yves Vindevogel <yves(dot)vindevogel(at)implements(dot)be>, 'Postgresql Performance' <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Insert performance (OT?)
Date: 2005-08-17 20:25:09
Message-ID: cs67g11p5k1pfkf6kcuvpnjubmmeutcni2@4ax.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Tue, 19 Jul 2005 11:51:51 +0100, Richard Huxton <dev(at)archonet(dot)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 :-(

Servus
Manfred

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Josh Berkus 2005-08-17 20:31:38 Re: Tuning Effective Cache Question
Previous Message Ron 2005-08-17 18:33:20 Re: Need for speed