Search Postgresql Archives

Re: COPY command details

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----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-----


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux