Re: Proposal: TRUNCATE TABLE table RESTRICT - Mailing list pgsql-hackers

From Mike Mascari
Subject Re: Proposal: TRUNCATE TABLE table RESTRICT
Date
Msg-id 394576EB.3254904B@mascari.com
Whole thread Raw
In response to Re: Proposal: TRUNCATE TABLE table RESTRICT  (JanWieck@t-online.de (Jan Wieck))
Responses Re: Proposal: TRUNCATE TABLE table RESTRICT
List pgsql-hackers
Jan Wieck wrote:
> 
> Mike Mascari wrote:
> > Sorry to ask for another favor, but what does Oracle do here? If
> > a referring table has 1,000,000 rows in it which have been
> > deleted but not vacuumed, what would the performance implications
> > be?
> 
>     Referential integrity has no performance impact on VACUUM. If
>     that's what you aren't sure about.
> 
> Jan

Actually, I was worried that if TRUNCATE were to vist all
referring tables to determine whether or not it was empty, rather
then just issuing an elog() at the first RI trigger encountered,
that it might wind up scanning a 1,000,000 tuple relation (the
referring relation) where all the rows have been marked as
deleted before determining that its okay to perform the TRUNCATE.
I was hoping that Oracle simply disallowed TRUNCATE on tables
with referring relations, regardless of whether or not there was
actually any data in them, so that PostgreSQL could do the same.
:-)

Mike Mascari


pgsql-hackers by date:

Previous
From: Lamar Owen
Date:
Subject: PostgreSQL 7.0.2-2 RPMset available.
Next
From: Don Baccus
Date:
Subject: Re: Proposal: TRUNCATE TABLE table RESTRICT