Re: COPY vs INSERT

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: COPY vs INSERT
Дата
Msg-id 13782.1115387515@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: COPY vs INSERT  (Bruno Wolff III <bruno@wolff.to>)
Список pgsql-performance
Bruno Wolff III <bruno@wolff.to> writes:
>   "Jim C. Nasby" <decibel@decibel.org> wrote:
>> Has thought been given to supporting inserting multiple rows in a single
>> insert?

> It's on the TODO list. I don't remember anyone bringing this up for about
> a year now, so I doubt anyone is actively working on it.

It is on TODO but I think it is only there for standards compliance.
It won't produce near as much of a speedup as using COPY does ---
in particular, trying to put thousands of rows through at once with
such a command would probably be a horrible idea.  You'd still have
to pay the price of lexing/parsing, and there would also be considerable
flailing about with deducing the data type of the VALUES() construct.
(Per spec that can be used in SELECT FROM, not only in INSERT, and so
it's not clear to what extent we can use knowledge of the insert target
columns to avoid running the generic union-type-resolution algorithm for
each column of the VALUES() :-(.)  Add on the price of shoving an
enormous expression tree through the planner and executor, and it starts
to sound pretty grim.

            regards, tom lane

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

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: COPY vs INSERT
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Bad choice of query plan from PG 7.3.6 to PG 7.3.9