Re: multiple inserts

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: multiple inserts
Дата
Msg-id 20050617195524.GC9670@wolff.to
обсуждение исходный текст
Ответ на Re: multiple inserts  ("Oren Mazor" <oren.mazor@gmail.com>)
Список pgsql-novice
On Fri, Jun 17, 2005 at 10:31:12 -0400,
  Oren Mazor <oren.mazor@gmail.com> wrote:
> hm. well. I'm looking at a data set that can potentially get a few
> thousand big. So I'll stick with the COPY command.
>
> the trick is that I'm inserting a 1000 row 20 column table. This gets
> super slow, as you can imagine, so I'm looking at creating a two tables, a
> 1000 row table with a single column (my unique identifiers) and a 20
> column table with a single row (the default values) and then UNIONing them.
>
> would doing a COPY be a better idea?

If you do the inserts in one transaction this should be reasonably fast.
If a program is doing the inserts more speed can be gained by using prepare.
However, copy is a better way to go if you aren't transforming or checking
the data as it is being inserted.

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

Предыдущее
От: Michael Fuhr
Дата:
Сообщение: Re: Trigger and Trigger function, Part 3 - success!
Следующее
От: "Vishal Kashyap @ [SaiHertz]"
Дата:
Сообщение: