pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: hatman <joel.winteregg@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Insert performance
Date: Tue, 06 Mar 2007 07:34:46 +0000
Message-ID: <45ED1996.7050008@archonet.com> (raw)
In-Reply-To: <1172596221.393824.41130@j27g2000cwj.googlegroups.com>
References: <1172596221.393824.41130@j27g2000cwj.googlegroups.com>

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



view thread (32+ messages)  latest in thread

Message-ID: <45ED1996.7050008@archonet.com>
Permalink:  ../45ED1996.7050008@archonet.com/
Also on:    postgresql.org/message-id/45ED1996.7050008@archonet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: dev@archonet.com, joel.winteregg@gmail.com
  Subject: Re: Insert performance
  In-Reply-To: <45ED1996.7050008@archonet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox