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