pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rod Taylor <pg@rbt.ca>
To: Brock Henry <brock.henry@gmail.com>
Cc: Postgresql Performance <pgsql-performance@postgresql.org>
Subject: Re: Insert performance, what should I expect?
Date: Tue, 19 Oct 2004 22:12:28 -0400
Message-ID: <1098238348.747.20.camel@home> (raw)
In-Reply-To: <97b3fe2041019185337a8c3d8@mail.gmail.com>
References: <97b3fe2041019185337a8c3d8@mail.gmail.com>

> I've done some manual benchmarking running my script 'time script.pl'
> I realise my script uses some of the time, bench marking shows that
> %50 of the time is spent in dbd:execute.

The perl drivers don't currently use database level prepared statements
which would give a small boost.

But your best bet is to switch to using COPY instead of INSERT. Two ways
to do this.

1) Drop DBD::Pg and switch to the Pg driver for Perl instead (non-DBI
compliant) which has functions similar to putline() that allow COPY to
be used.

2) Have your perl script output a .sql file with the data prepared (COPY
statements) which you feed into the database via psql.

You can probably achieve a 50% increase in throughput.




view thread (8+ messages)  latest in thread

Message-ID: <1098238348.747.20.camel@home>
Permalink:  ../1098238348.747.20.camel@home/
Also on:    postgresql.org/message-id/1098238348.747.20.camel@home

 · 

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: pg@rbt.ca, brock.henry@gmail.com
  Subject: Re: Insert performance, what should I expect?
  In-Reply-To: <1098238348.747.20.camel@home>

* 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