Re: [GENERAL] Performance

Поиск
Список
Период
Сортировка
От Charles Tassell
Тема Re: [GENERAL] Performance
Дата
Msg-id 4.2.0.58.19991029051428.00a5fa80@mailer.isn.net
обсуждение исходный текст
Ответ на Performance  ("Jason C. Leach" <jcl@mail.ocis.net>)
Список 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@mail.ocis.net.
>.. http://www.ocis.net/~jcl
>.
>
>The Search for Extraterrestrial Intelligence from Home:
>http://setiathome.ssl.berkeley.edu
>
>                                                                 LINUX!
>
>
>
>
>************


В списке pgsql-general по дате отправления:

Предыдущее
От: Jim Richards
Дата:
Сообщение: Re: [GENERAL] Performance
Следующее
От: Jurgen Defurne
Дата:
Сообщение: Re: [GENERAL] next steps