Re: [HACKERS] Repetitive code in RI triggers

From: Ildar Musin <i(dot)musin(at)postgrespro(dot)ru>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Maksim Milyutin <milyutinma(at)gmail(dot)com>, Daniel Gustafsson <daniel(at)yesql(dot)se>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Subject: Re: [HACKERS] Repetitive code in RI triggers
Date: 2017-11-20 08:53:38
Message-ID: 557339c8-46f0-666a-8a3d-e5a3ba35daf6@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-hackers

On 19.11.2017 00:31, Tom Lane wrote:
> Ildar Musin <i(dot)musin(at)postgrespro(dot)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(dot)musin(at)postgrespro(dot)ru

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message 高增琦 2017-11-20 09:00:41 Re: no library dependency in Makefile?
Previous Message Fabien COELHO 2017-11-20 08:45:58 Re: [HACKERS] pgbench regression test failure