Re: single transaction vs multiple transactions

Поиск
Список
Период
Сортировка
От Sven Geisler
Тема Re: single transaction vs multiple transactions
Дата
Msg-id 45759726.9060004@aeccom.com
обсуждение исходный текст
Ответ на Re: single transaction vs multiple transactions  ("Heikki Linnakangas" <heikki@enterprisedb.com>)
Список pgsql-performance
Hi,

Many thanks for the fast response.
I will use temporary table with copy.
Other issue I have is the connection between app and db.
I guess, the approach with the copy will also hold down the network I/O
between app and db. Keeping in mind that I produce 10,000+ statements.

Thx
Sven

Heikki Linnakangas schrieb:
> Sven Geisler wrote:
>> I have to insert my arguments to a temporary table first, because the
>> arguments are only known in the application tier.
>> Is a multiple insert to a temporary table and a final 'DELETE FROM x
>> WHERE y IN (SELECT z FROM tmp)' faster than multiple deletes?
>
> If the number of records is high, it most likely is faster. You should
> try it with your data to be sure, but in general doing all the deletes
> in one batch is faster when the number of records is high because it
> allows using efficient merge joins or sequential scans.
>
> Populating the temporary table with no indexes should be quite
> inexpensive if you make sure you don't do it one record at a time. Use
> the COPY command or batched inserts instead.
>
>

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

Предыдущее
От: "Heikki Linnakangas"
Дата:
Сообщение: Re: single transaction vs multiple transactions
Следующее
От: Tom Lane
Дата:
Сообщение: Re: single transaction vs multiple transactions