Re: INSERT/SELECT and excessive foreign key checks - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: INSERT/SELECT and excessive foreign key checks
Date
Msg-id 46C82D2D.7060707@dunslane.net
Whole thread Raw
In response to Re: INSERT/SELECT and excessive foreign key checks  (Gregory Stark <stark@enterprisedb.com>)
Responses Re: INSERT/SELECT and excessive foreign key checks  (Gregory Stark <stark@enterprisedb.com>)
Re: INSERT/SELECT and excessive foreign key checks  (James Mansion <james@mansionfamily.plus.com>)
List pgsql-hackers

Gregory Stark wrote:
> "Lodewijk Voege" <lvoege@gmail.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


pgsql-hackers by date:

Previous
From: Gregory Stark
Date:
Subject: Re: INSERT/SELECT and excessive foreign key checks
Next
From: Gregory Stark
Date:
Subject: Re: INSERT/SELECT and excessive foreign key checks