I'm sure this is a simple question but the docs only go as far as "For all 
indexes except the shared system catalogs, REINDEX is crash-safe and 
transaction-safe."

I have a transaction that imports about 2.3 GB of data as pairs of DELETE 
FROM / COPY.

What is the difference between reindexing tables during this transaction vs 
after? ie 

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;

vs

BEGIN WORK;
DELETE FROM X; COPY X ...;
DELETE FROM Y; COPY Y ...;
DELETE FROM Z; COPY Z ...;
COMMIT;

REINDEX TABLE X;
REINDEX TABLE Y;
REINDEX TABLE Z;


Thanks 

Ashley

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

Reply via email to