Re: COPY command details

Поиск
Список
Период
Сортировка
От Ron Johnson
Тема Re: COPY command details
Дата
Msg-id 460C1EF1.5080800@cox.net
обсуждение исходный текст
Ответ на Re: COPY command details  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-general
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 03/29/07 14:41, Bruce Momjian wrote:
> Benjamin Arai wrote:
>> So, is there a way to defer the index updating until a later period
>> of time.  More specifically, I would like to do several COPIES to a
>> running database, then afterward force a update on the index via a
>> vacuum or something similar.
>
> Sure, drop the index, do the COPY, and then recreate the index.  That is
> done often.

ALTER INDEX xxxx MAINTENANCE IS DISABLED would be helpful, so that
you don't have to be dragging around (possibly changing) SQL around
"everywhere".

So, an example would be from an evening load job would be:
  ALTER INDEX foobar_idx MAINTENANCE IS DISABLED;
  COPY foo FROM 'blarg';
  REINDEX INDEX foobar_idx;

So if the DBA decides that foobar_idx needs different fields, you
don't have to edit the evening load job when the index changes.

- --
Ron Johnson, Jr.
Jefferson LA  USA

Give a man a fish, and he eats for a day.
Hit him with a fish, and he goes away for good!

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGDB7xS9HxQb37XmcRAqzuAJwK9LATewVE6GwJg/us6p5KzznWAgCfSZ9J
xtqWwHsVMvjuoSYP+/rEfNE=
=nJ+F
-----END PGP SIGNATURE-----

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

Предыдущее
От: "Dmitry Koterov"
Дата:
Сообщение: Re: How to speedup CHECKPOINTs?
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: COPY command details