Re: Insert performance (OT?)

Поиск
Список
Период
Сортировка
От John A Meinel
Тема Re: Insert performance (OT?)
Дата
Msg-id 4303B3F4.9010306@arbash-meinel.com
обсуждение исходный текст
Ответ на Re: Insert performance (OT?)  (Manfred Koizar <mkoi-pg@aon.at>)
Список pgsql-performance
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
>


Вложения

В списке pgsql-performance по дате отправления:

Предыдущее
От: Manfred Koizar
Дата:
Сообщение: Re: Insert performance (OT?)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] bitmap scan issues 8.1 devel