Re: Question about \copy

From: "F(dot) Jovan Jester" <jesterj(at)groupspeak(dot)com>
To: johnw822003(at)yahoo(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Question about \copy
Date: 2009-03-11 17:50:16
Message-ID: 715F4E91-F016-4697-9611-DD09AC83908D@groupspeak.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mar 11, 2009, at 1:21 PM, John Wang wrote:
> I have a table, for example, Product. It's index is Product_index.
>
> If I use \copy to load data into the table:
>
> \copy Product from data.txt
>
> Will the index, Product_index, also be updated with the new data
> during "copy"?

Yes, and indexes are updated row by row even if bulk loading with
COPY. That's why when you're loading large amounts of data the index
updating and constraint checking can slow it down. See the manual info
on populating:

http://www.postgresql.org/docs/8.3/interactive/populate.html

-Jovan

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bob Pawley 2009-03-11 17:56:52 Re: Server Shutting Down
Previous Message Scott Marlowe 2009-03-11 17:37:07 Re: Question about \copy