pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Crosby <ryusei@gmail.com>
To: Dawid Kuroczko <qnex42@gmail.com>
Cc: Kevin Grittner <Kevin.Grittner@wicourts.gov>
Cc: jd@commandprompt.com
Cc: pgsql-performance@postgresql.org
Subject: Re: Looking for tips
Date: Tue, 19 Jul 2005 16:28:26 -0400
Message-ID: <1efd553a050719132836c31b78@mail.gmail.com> (raw)
In-Reply-To: <758d5e7f0507191319636afaa3@mail.gmail.com>
References: <s2dd0700.023@gwmta.wicourts.gov>
	<1efd553a0507191308219a098b@mail.gmail.com>
	<758d5e7f0507191319636afaa3@mail.gmail.com>

> If it is possible try:
> 1) wrapping many inserts into one transaction
> (BEGIN;INSERT;INSERT;...INSERT;COMMIT;).  As PostgreSQL will need to
> handle less transactions per second (each your insert is a transaction), it
> may work faster.

Aye, that's what I have it doing right now. The transactions do save a
HUGE chunk of time. (Cuts it down by about 40%).

> 2) If you can do 1, you could go further and use a COPY command which is
> the fastest way to bulk-load a database.

I don't think I can use COPY in my case because I need to do
processing on a per-line basis, and I need to check if the item I want
to insert is already there, and if it is, I need to get it's ID so I
can use that for further processing.



view thread (28+ messages)  latest in thread

Message-ID: <1efd553a050719132836c31b78@mail.gmail.com>
Permalink:  ../1efd553a050719132836c31b78@mail.gmail.com/
Also on:    postgresql.org/message-id/1efd553a050719132836c31b78@mail.gmail.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: ryusei@gmail.com, qnex42@gmail.com, Kevin.Grittner@wicourts.gov, jd@commandprompt.com
  Subject: Re: Looking for tips
  In-Reply-To: <1efd553a050719132836c31b78@mail.gmail.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