Re: really quick multiple inserts can use COPY?

Поиск
Список
Период
Сортировка
От Andreas Kretschmer
Тема Re: really quick multiple inserts can use COPY?
Дата
Msg-id 20061211165731.GA11970@KanotixBox
обсуждение исходный текст
Ответ на really quick multiple inserts can use COPY?  ("Jens Schipkowski" <jens.schipkowski@apus.co.at>)
Ответы Re: really quick multiple inserts can use COPY?  (imad <immaad@gmail.com>)
Список pgsql-performance
Jens Schipkowski <jens.schipkowski@apus.co.at> schrieb:

> Hello!
>
> In our JAVA application we do multiple inserts to a table by data from a
> Hash Map. Due to poor database access implemention - done by another
> company (we got the job to enhance the software) - we cannot use prepared
> statements. (We are not allowed to change code at database access!)
> First, we tried to fire one INSERT statement per record to insert. This
> costs 3 ms per row which is to slow because normally we insert 10.000
> records which results in 30.000 ms just for inserts.

Can you change this from INSERT-Statements to COPY? Copy is *much*
faster than INSERT.

If no, do you using all INSERTs in one transaction? I believe, a 'BEGIN'
and a 'COMMIT' around all INSERTs may increase the speed.


Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."    (unknow)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°

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

Предыдущее
От: "Jens Schipkowski"
Дата:
Сообщение: really quick multiple inserts can use COPY?
Следующее
От: "Rajesh Kumar Mallah"
Дата:
Сообщение: Re: really quick multiple inserts can use COPY?