Re: slow inserts

Поиск
Список
Период
Сортировка
От Ferdinand Smit
Тема Re: slow inserts
Дата
Msg-id 200203251006.g2PA6IV27531@server9.telegraafnet.nl
обсуждение исходный текст
Ответ на Re: slow inserts  (Morten Sickel <Morten.Sickel@nrpa.no>)
Список pgsql-admin
<ZIP>

> my $dbh=DBI->connect(dbi:Pg ...);
>
> my $insh = $dbh->prepare("Insert into table values (?,?,?)";
>

$insh->begin_work;

> foreach ($excelrow){
>  parse;
>  $insh->execute($data1,$data2,$data3);
> }

$insh->commit;

>
> I have written a few script of that kind my self, and I was really
> surprised how much it mattered when I managed to move a $dbi->prepare out
> of the insert loop.

Try to use transactions, that increates the speed too.

Regards,
Ferdinand

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

Предыдущее
От: "Fred Moyer"
Дата:
Сообщение: Re: large table support 32,000,000 rows
Следующее
От: "Niclas Gustafsson"
Дата:
Сообщение: Re: to --enable-locale or not to --enable-locale?