Re: Insert multiple Rows

Поиск
Список
Период
Сортировка
От Christoph Haller
Тема Re: Insert multiple Rows
Дата
Msg-id 3E65B76E.D6E118D7@rodos.fzk.de
обсуждение исходный текст
Ответ на Insert multiple Rows  (saintxplo@yahoo.com.ar (Saint X))
Список pgsql-sql
>
> If you use a 'prepared' insert within a transaction, would that speed
things
> up - maybe by defering index updates?
>
I doubt it.


From: Neil Conway <neilc@samurai.com>
... I'd suspect that for most INSERT queries, the
parsing/rewriting/planning stages are relatively inexpensive, and the
bulk of the runtime is spent in the executor (and writing WAL records,
etc). So my guess would be that you won't see that much of a performance

improvement from this...

I've noticed a real performance boost using COPY

something like ...

PQexec("COPY xxx FROM stdin");
for (...)
{   sprintf(buf, "%d\t%d\t...\n",           values[0], values[1], ... values[n]);   PQputline(conn, buf);
}
PQputline(conn, "\\.\n");
PQendcopy(conn);

runs like hell.

Regards, Christoph




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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Forcing query to use an index
Следующее
От: Rod Taylor
Дата:
Сообщение: Re: Sorting by NULL values