Skip site navigation (1) Skip section navigation (2)

COPY and index updating

From: "David Monarchi" <david(dot)e(dot)monarchi(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: COPY and index updating
Date: 2007-07-04 20:22:56
Message-ID: eea51fdb0707041322v121ab054re1435fa8a743a498@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
PG 8.2.4

Hello -

I need to append rows to an existing table that is in a production db.
There are 60 fields in the table and 17 indexes, including the primary key.
I cannot drop the indexes because the data is being actively accessed by
users.  I can't create a duplicate table because we do not have enough disk
storage to do so at this time.

I believe that the SQL COPY statement will delay updating the indexes until
after it has inserted the rows because (again, I believe) the copy is
treated as a single transaction that either succeeds or fails.

I would appreciate knowing if I am correct about this.

Thank you,

David

Responses

pgsql-novice by date

Next:From: Sean DavisDate: 2007-07-04 20:57:17
Subject: Re: COPY and index updating
Previous:From: Tiemo KieftDate: 2007-07-03 20:48:40
Subject: Re: Multiple inserts into 2 tables with FKs

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group