Re: REINDEX during a transaction

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ashley Moran <ashley(dot)moran(at)codeweavers(dot)net>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: REINDEX during a transaction
Date: 2006-03-01 15:23:41
Message-ID: 10725.1141226621@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Ashley Moran <ashley(dot)moran(at)codeweavers(dot)net> writes:
> BEGIN WORK;
> DELETE FROM X; COPY X ...; REINDEX TABLE X;
> DELETE FROM Y; COPY Y ...; REINDEX TABLE Y;
> DELETE FROM Z; COPY Z ...; REINDEX TABLE Z;
> COMMIT;

Why don't you use TRUNCATE? Why do you think you need REINDEX at all?

If you do need it, you'd be best off to drop the indexes, truncate,
copy, re-create the indexes. See
http://www.postgresql.org/docs/8.1/static/populate.html#POPULATE-RM-INDEXES

regards, tom lane

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Michael Fuhr 2006-03-01 15:26:20 Re: Reg:lo_open error..pls help me
Previous Message sandhya 2006-03-01 12:18:51 Reg:lo_open error..pls help me