Re: Huge memory consumption on partitioned table with FKs
Kyotaro Horiguchi <horikyota.ntt@gmail.com>
From: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
To: keisuke.kuroda.3862@gmail.com
Cc: amitlangote09@gmail.com, alvherre@alvh.no-ip.org,
tatsuro.yamada.tf@nttcom.co.jp, pgsql-hackers@lists.postgresql.org,
tatsuhito.kasahara.rd@hco.ntt.co.jp
Date: 2020-12-04T05:48:22Z
Lists: pgsql-hackers
At Fri, 4 Dec 2020 12:00:09 +0900, Keisuke Kuroda <keisuke.kuroda.3862@gmail.com> wrote in > Hi Amit, > > > I have attached a patch in which I've tried to merge the ideas from > > both my patch and Kuroda-san's. I liked that his patch added > > conparentid to RI_ConstraintInfo because that saves a needless > > syscache lookup for constraints that don't have a parent. I've kept > > my idea to compute the root constraint id only once in > > ri_LoadConstraint(), not on every invocation of ri_BuildQueryKey(). > > Kuroda-san, anything you'd like to add to that? > > Thank you for the merge! It looks good to me. > I think a fix for InvalidateConstraintCacheCallBack() is also good. > > I also confirmed that the patch passed the make check-world. It's fine that constraint_rood_id overrides constraint_id, but how about that constraint_root_id stores constraint_id if it is not a partition? That change makes the patch a bit simpler. regards. -- Kyotaro Horiguchi NTT Open Source Software Center
Commits
-
Avoid creating duplicate cached plans for inherited FK constraints.
- c3ffe3486368 14.0 landed