Re: COPY command details - Mailing list pgsql-general

From Ron Johnson
Subject Re: COPY command details
Date
Msg-id 460C1EF1.5080800@cox.net
Whole thread Raw
In response to Re: COPY command details  (Bruce Momjian <bruce@momjian.us>)
List 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 by date:

Previous
From: "Dmitry Koterov"
Date:
Subject: Re: How to speedup CHECKPOINTs?
Next
From: Bruce Momjian
Date:
Subject: Re: COPY command details