Re: Memory consumed by child SpecialJoinInfo in partitionwise join planning
Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
From: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
To: Amit Langote <amitlangote09@gmail.com>
Cc: Richard Guo <guofenglinux@gmail.com>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2023-10-03T13:12:28Z
Lists: pgsql-hackers
Attachments
- 0001-Report-memory-used-for-planning-a-query-in--20231003.patch (text/x-patch) patch 0001
- 0002-Reduce-memory-used-by-child-SpecialJoinInfo-20231003.patch (text/x-patch) patch 0002
- 0003-Address-Amit-s-comments-20231003.patch (text/x-patch) patch 0003
On Fri, Sep 29, 2023 at 8:36 AM Amit Langote <amitlangote09@gmail.com> wrote: > IOW, something > like the following would have sufficed: > > @@ -1735,6 +1735,10 @@ build_child_join_sjinfo(PlannerInfo *root, > SpecialJoinInfo *parent_sjinfo, > /* > * free_child_sjinfo_members > * Free memory consumed by members of a child SpecialJoinInfo. > + * > + * Only members that are translated copies of their counterpart in the parent > + * SpecialJoinInfo are freed here. However, members that could be referenced > + * elsewhere are not freed. > */ > static void > free_child_sjinfo_members(SpecialJoinInfo *child_sjinfo) > @@ -1755,10 +1759,7 @@ free_child_sjinfo_members(SpecialJoinInfo *child_sjinfo) > bms_free(child_sjinfo->syn_lefthand); > bms_free(child_sjinfo->syn_righthand); > > - /* > - * But the list of operator OIDs and the list of expressions may be > - * referenced somewhere else. Do not free those. > - */ > + /* semi_rhs_exprs may be referenced, so don't free. */ > } Works for me. PFA patchset with these changes. I have still left the changes addressing your comments as a separate patch for easier review. -- Best Wishes, Ashutosh Bapat
Commits
-
Code review for 6190d828cd2
- 0f7863afef67 17.0 landed
-
Do not translate dummy SpecialJoinInfos for child joins
- 6190d828cd25 17.0 landed
-
Reduce memory used by partitionwise joins
- 5278d0a2e870 17.0 landed
-
Remove dummy_spinlock
- 55627ba2d334 17.0 cited