Re: Insert performance - Mailing list pgsql-performance

From Richard Huxton
Subject Re: Insert performance
Date
Msg-id 45ED1996.7050008@archonet.com
Whole thread Raw
In response to Insert performance  ("hatman" <joel.winteregg@gmail.com>)
Responses Re: Insert performance
List pgsql-performance
hatman wrote:
> Dear all,
>
> After many tests and doc reading, i finally try to get help from
> you...
>
> Here is my problem. With some heavy insert into a simple BD (one
> table, no indexes) i can't get better perf than 8000 inserts/sec. I'm
> testing it using a simple C software which use libpq and which use:
> - Insert prepared statement (to avoid too many request parsing on the
> server)
> - transaction of 100000 inserts

Are each of the INSERTs in their own transaction?

If so, you'll be limited by the speed of the disk the WAL is running on.

That means you have two main options:
1. Have multiple connections inserting simultaneously.
2. Batch your inserts together, from 10 to 10,000 per transaction.

Are either of those possible?

--
   Richard Huxton
   Archonet Ltd

pgsql-performance by date:

Previous
From: ismo.tuononen@solenovo.fi
Date:
Subject: Re: query slows down after vacuum analyze
Next
From: Richard Huxton
Date:
Subject: Re: Hibernate left join