Re: Howto use "COPY FROM" with the native API?

Поиск
Список
Период
Сортировка
От Andy Chambers
Тема Re: Howto use "COPY FROM" with the native API?
Дата
Msg-id op.vtsefksacqhz04@vaio.mcnaitdept
обсуждение исходный текст
Ответ на Howto use "COPY FROM" with the native API?  (Clemens Eisserer <linuxhippy@gmail.com>)
Список pgsql-general
On Mon, 11 Apr 2011 11:21:16 -0400, Clemens Eisserer
<linuxhippy@gmail.com> wrote:

> Hi,
>
> We are working on an university project for network traffic accounting.
> We use ulogd-2 to log netfilter packets, however it creates for each
> packet a seperate transaction and also doesn't use prepared
> statements, which results in horrible performance.
>
> What we are looking for is a low-overhead way of inserting many rows
> (100-1000) into a table at once in one transaction.
> Is "COPY FROM STDIN"  a good idea in this case?

For that many, you can probably get away with

insert into foo values
   (1, 2, 3),
   (4, 5, 6)

..rather than having to figure out the "COPY FROM" API.

Cheers,
Andy

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

Предыдущее
От: Willy-Bas Loos
Дата:
Сообщение: CREATE RULE _copy AS ON COPY TO ...
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: Howto use "COPY FROM" with the native API?