Re: INSERT/SELECT and excessive foreign key checks

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: Lodewijk Voege <lvoege(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: INSERT/SELECT and excessive foreign key checks
Date: 2007-08-19 11:44:45
Message-ID: 46C82D2D.7060707@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Gregory Stark wrote:
> "Lodewijk Voege" <lvoege(at)gmail(dot)com> writes:
>
>
>> I hacked up a patch that handles these two cases:
>> - for such an INSERT/SELECT, check constant FKs only once.
>>
>
> This sounds like a clever idea. It seems the abstraction violation is worth it
> to me.
>

Could we achieve the same thing in a more general way by having a per-FK
tiny (say 10?) LRU cache of values checked. Then it wouldn't only be
restricted to constant expressions. Of course, then the trigger would
need to keep state, so it might well be too complex (e.g. what if there
are are concurrent inserts?)

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2007-08-19 12:12:59 Re: INSERT/SELECT and excessive foreign key checks
Previous Message Gregory Stark 2007-08-19 10:17:04 Re: INSERT/SELECT and excessive foreign key checks