Re: Optimizing huge inserts/copy's

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Jie Liang <jliang(at)ipinc(dot)com>
Cc: Webb Sprague <wsprague100(at)yahoo(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Optimizing huge inserts/copy's
Date: 2000-08-30 20:06:46
Message-ID: Pine.BSF.4.10.10008301302010.62222-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


On Wed, 30 Aug 2000, Jie Liang wrote:

> Hi,
>
> I knew that if no constarint, it populate very quick, my question is:
> when two tables have been
> reloaded, then I want to add a foreign key constraint to it, say:
> tableA has primary key column (id)
> tableB has a column (id) references it, so I say:
> ALTER TABLE tableB ADD CONSTRAINT distfk FOREIGN KEY (id) REFERENCES
> tableA(id) ON DELETE CASCADE ;

Yeah, the alter table has to check that the constraint is valid. There
might be a faster way than the current "scan through table calling
trigger function" mechanism, although doing most of them starts pulling
logic for the obeying constraint into multiple places.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2000-08-30 20:22:49 Re: Optimizing huge inserts/copy's
Previous Message Jie Liang 2000-08-30 19:20:05 Re: Optimizing huge inserts/copy's