Re: Batch Inserts

From: Doug Fields <dfields-pg-general(at)pexicom(dot)com>
To: "Ricardo Ryoiti S(dot) Junior" <suga(at)netbsd(dot)com(dot)br>
Cc: pgsql-general(at)postgresql(dot)org, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Batch Inserts
Date: 2002-12-11 23:03:30
Message-ID: 5.1.0.14.2.20021211180132.021d39e8@pop.pexicom.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Ricardo, list,

One quick question:

> - If your "data importing" is done via inserts, make sure that the
>batch uses transactions for each (at least or so) 200 inserts. If you
>don't, each insert will be a transaction, what will slow down you.

I use JDBC and use it with the default "AUTOCOMMIT ON."

Does doing a statement, in one JDBC execution, of the form:

BEGIN WORK; INSERT ... ; INSERT ... ; INSERT ...; COMMIT;

Count as N individual inserts (due to the autocommit setting) or does the
BEGIN WORK;...COMMIT; surrounding it override that setting?

Thanks,

Doug

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Toby Tremayne 2002-12-11 23:42:45 Re: refursor from dynamic query
Previous Message Ian Barwick 2002-12-11 22:25:56 Re: 7.2.x -> 7.3 upgrade docs?