On Mon, 11 Apr 2011 11:21:16 -0400, Clemens Eisserer
<linuxhippy(at)gmail(dot)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