pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Creager <Robert_Creager@LogicalChaos.org>
To: Rod Taylor <pg@rbt.ca>
Cc: Brock Henry <brock.henry@gmail.com>
Cc: Postgresql Performance <pgsql-performance@postgresql.org>
Subject: Re: Insert performance, what should I expect?
Date: Wed, 20 Oct 2004 10:45:27 -0600
Message-ID: <20041020104527.14927c06@thunder.mshome.net> (raw)
In-Reply-To: <1098238348.747.20.camel@home>
References: <97b3fe2041019185337a8c3d8@mail.gmail.com>
	<1098238348.747.20.camel@home>

When grilled further on (Tue, 19 Oct 2004 22:12:28 -0400),
Rod Taylor <pg@rbt.ca> confessed:

> > 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.
> > 
> 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.

COPY can be used with DBD::Pg, per a script I use:

$dbh->do( "COPY temp_obs_$band ( $col_list ) FROM stdin" );
$dbh->func( join ( "\t", @data ) . "\n", 'putline' );
$dbh->func( "\\.\n", 'putline' );
$dbh->func( 'endcopy' );

With sets of data from 1000 to 8000 records, my COPY performance is consistent
at ~10000 records per second.

Cheers,
Rob

-- 
 10:39:31 up 2 days, 16:25,  2 users,  load average: 2.15, 2.77, 3.06
Linux 2.6.5-02 #8 SMP Mon Jul 12 21:34:44 MDT 2004

view thread (8+ messages)  latest in thread

Message-ID: <20041020104527.14927c06@thunder.mshome.net>
Permalink:  ../20041020104527.14927c06@thunder.mshome.net/
Also on:    postgresql.org/message-id/20041020104527.14927c06@thunder.mshome.net

 · 

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: Robert_Creager@LogicalChaos.org, pg@rbt.ca, brock.henry@gmail.com
  Subject: Re: Insert performance, what should I expect?
  In-Reply-To: <20041020104527.14927c06@thunder.mshome.net>

* 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