Re: faster inserting from dump?

Поиск
Список
Период
Сортировка
От Gregory Wood
Тема Re: faster inserting from dump?
Дата
Msg-id 000501c0bdd8$10b1fea0$7889ffcc@comstock.com
обсуждение исходный текст
Ответ на faster inserting from dump?  ("chris markiewicz" <cmarkiew@commnav.com>)
Список pgsql-general
> how can i increase the speed of building a database from a dump?  there
are
> currently many tens-of-thousands of insert statements...i assume that a
> commit is run after each statement?

Correct... every statement is wrapped in an implicit transaction if an
explicit one is not provided.

> i am guessing that it would be faster
> if i commit after every hundred or thousand?

Correct again.

> is there an easy way to tell psql to do this?

Just use BEGIN; and COMMIT; to denote a transaction block. That's it!

You might also want to research the COPY command for doing bulks imports. I
personally use INSERTs because I need to have my importing error checked,
but if you can guarantee the integrity of the import, COPY is your best bet.

Greg


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

Предыдущее
От: "chris markiewicz"
Дата:
Сообщение: faster inserting from dump?
Следующее
От: z.nijmeyers@cable.a2000.nl
Дата:
Сообщение: Re: Re: compiling on IRIX 6.3 or does anyone hav a tar of the (irix)compiled include dir for me?