Re: [GENERAL] Performance

From: Charles Tassell <ctassell(at)isn(dot)net>
To: "Jason C(dot) Leach" <jcl(at)mail(dot)ocis(dot)net>, pgsql-list <pgsql-general(at)hub(dot)org>
Subject: Re: [GENERAL] Performance
Date: 1999-10-29 08:22:23
Message-ID: 4.2.0.58.19991029051428.00a5fa80@mailer.isn.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Try turning off DBI's autocommit , that way it will cache all the inserts
until it's sure there are no errors, then just do the one write to the
database. You do this by changing your DBI connect command from:
$pg_con=DBI->connect("DBI:Pg:....."
to
$pg_con=DBI->connect("DBI:Pg(AutoCommit=>0):....."

Don't forget to call $pg_con->commit; before disconnecting or else you will
lose your added data.

At 04:47 AM 10/29/99, Jason C. Leach wrote:
>hi,
>
>I've been playing with pgsql for a few days now and am getting the hang
>of it. I just did a loop that inserts a few thousand records into a
>table. I did a statement, prepare, execute; it worked fine although pg
>seemed to access the hd for every insert. Is there a way to cache
>inserts and then write them all at once later. I'm using Perl with
>DBD::Pg/DBI and see with DBI there is a prepare_cached, and a commit.
>Not much in the way of docs for the modules though.
>
>Perhaps I should be doing statement, prepare, statement, prepare,
>commit?
>
>I'd also be curious where you start postgres with the -F option? I did
>not see it as a postmaster option.
>
>This is just a curiosity, but some of the MS Certified people are being
>taught that MS SQL server requires something like a PIII with 512MB
>RAM. That's pretty crazy, if you ask me, but I can see it as being
>dependent on how many requests you server will need to deal with. On
>equal machines, could pg handle more or less requests that MS SQL?
>
>Thanks,
> Jason
>
>--
>.............
>......... Jason C. Leach
>...... University College of the Cariboo
>... jcl(at)mail(dot)ocis(dot)net(dot)
>.. http://www.ocis.net/~jcl
>.
>
>The Search for Extraterrestrial Intelligence from Home:
>http://setiathome.ssl.berkeley.edu
>
> LINUX!
>
>
>
>
>************

In response to

  • Performance at 1999-10-29 07:47:18 from Jason C. Leach

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Good 1999-10-29 13:00:05 Re: [GENERAL] Studying
Previous Message Jim Richards 1999-10-29 08:16:30 Re: [GENERAL] Performance