Re: [HACKERS] Repetitive code in RI triggers - Mailing list pgsql-hackers

From Ildar Musin
Subject Re: [HACKERS] Repetitive code in RI triggers
Date
Msg-id 557339c8-46f0-666a-8a3d-e5a3ba35daf6@postgrespro.ru
Whole thread Raw
In response to Re: [HACKERS] Repetitive code in RI triggers  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers

On 19.11.2017 00:31, Tom Lane wrote:
> Ildar Musin <i.musin@postgrespro.ru> writes:
>> [ ri_triggers_v2.patch ]
>
> Pushed with two minor improvements.  I noticed that ri_setdefault could
> just go directly to ri_restrict rather than call the two separate triggers
> that would end up there anyway; that lets its argument be "TriggerData
> *trigdata" for more consistency with the other cases.  Also, this patch
> made it very obvious that we were caching identical queries under hash
> keys RI_PLAN_RESTRICT_DEL_CHECKREF and RI_PLAN_RESTRICT_UPD_CHECKREF,
> so we might as well just use one hash entry for both cases, saving a few
> lines of code as well as a lot of cycles.  Likewise in the other two
> functions.
>
>             regards, tom lane
>

Great, thanks

-- 
Ildar Musin
i.musin@postgrespro.ru


pgsql-hackers by date:

Previous
From: Fabien COELHO
Date:
Subject: Re: [HACKERS] pgbench regression test failure
Next
From: 高增琦
Date:
Subject: Re: no library dependency in Makefile?