Re: bulk insert performance problem

Поиск
Список
Период
Сортировка
От Mark Stosberg
Тема Re: bulk insert performance problem
Дата
Msg-id ftft7g$19r$2@ger.gmane.org
обсуждение исходный текст
Ответ на bulk insert performance problem  ("Christian Bourque" <christian.bourque@gmail.com>)
Ответы Re: bulk insert performance problem
Список pgsql-performance
Christian Bourque wrote:
>
> Any idea? Is there any other improvements I could do?

Are you using the "COPY" syntax in the import script or individual
insert statements? Using COPY will always be *much* faster.

I believe COPY always appends to tables rather than replacing the
contents, you can combine this technique with the possibility of
splitting up the task into multiple copy statements, but that has never
been necessary in my case, switching from INSERTS to a COPY statement
always provided the huge performance improvement I needed.

It's easy to confuse "pg_dump -d" with "psql -d" ...it's too bad they
mean very different things.

For pg_dump, "-d" causes INSERT statements to be generated instead of a
COPY statement, and is has been a mistake I made in the past, because I
expected to work like "psql -d", where "-d" means "database name".

I suppose the safe thing to do is to avoid using "-d" altogether!


    Mark

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

Предыдущее
От: Mark Stosberg
Дата:
Сообщение: Re: what worked: performance improvements for geo-spatial searching on FreeBSD
Следующее
От: Matthew
Дата:
Сообщение: Re: bulk insert performance problem