Re: Copying records from TABLE_A to TABLE_B (in the same database)

Поиск
Список
Период
Сортировка
От Peter J. Holzer
Тема Re: Copying records from TABLE_A to TABLE_B (in the same database)
Дата
Msg-id 20220802194157.d6uoa5mwtsg2jbd4@hjp.at
обсуждение исходный текст
Ответ на Re: Copying records from TABLE_A to TABLE_B (in the same database)  (Rob Sargent <robjsargent@gmail.com>)
Список pgsql-general
On 2022-08-02 13:08:41 -0600, Rob Sargent wrote:
>         If you can get outside sql, the bulk copy facilities (CopyManager in
>         java) is blindingly fast for me.
>
>
>     ??
>
>
> I meant using tools other than sql (and psql).   I have java code using
> org.postgresql.copy package

I don't know that package but I'm pretty sure it's just using the
PostgreSQL COPY command.

> because straight insert was too slow for large numbers of rows.

The OP already has the data in the database. In my experience[1] copying
from one table to another is quite a bit faster that copying into the
database (and therefore also copying out AND copying in).

        hp

[1] https://github.com/hjp/dbbench/blob/master/import_pg_comparison/results/akran.2019-12-15/results.png


--
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Вложения

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

Предыдущее
От: Rob Sargent
Дата:
Сообщение: Re: Copying records from TABLE_A to TABLE_B (in the same database)
Следующее
От: Thomas Munro
Дата:
Сообщение: Re: Strange collation names ("hu_HU.UTF-8")