Re: Restore v. Running COPY/INDEX seperatly

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Benjamin Arai <me(at)benjaminarai(dot)com>
Cc: Gregory Stark <stark(at)enterprisedb(dot)com>, "Oleg Bartunov" <oleg(at)sai(dot)msu(dot)su>, "PostgreSQL" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Restore v. Running COPY/INDEX seperatly
Date: 2007-08-27 14:59:26
Message-ID: 278.1188226766@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Benjamin Arai <me(at)benjaminarai(dot)com> writes:
> Why is a trigger faster than doing a ALTER after table is created? I
> thought a trigger would be slower because it would be invoked every
> iteration (a new row is inserted) during the COPY process.

Yeah, you'd have the trigger overhead, but the above argument ignores
the costs of the full-table UPDATE --- not to mention the VACUUM
you'll need after the UPDATE to clean up the dead rows.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Sullivan 2007-08-27 15:04:14 Re: Bigtime scaling of Postgresql (cluster and stuff I suppose)
Previous Message Vivek Khera 2007-08-27 14:49:46 Re: Bigtime scaling of Postgresql (cluster and stuff I suppose)