Re: Memory consumed by child SpecialJoinInfo in partitionwise join planning

From: Amit Langote <amitlangote09(at)gmail(dot)com>
To: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
Cc: Andrei Lepikhov <a(dot)lepikhov(at)postgrespro(dot)ru>, Richard Guo <guofenglinux(at)gmail(dot)com>, Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, vignesh C <vignesh21(at)gmail(dot)com>
Subject: Re: Memory consumed by child SpecialJoinInfo in partitionwise join planning
Date: 2024-03-18 12:09:49
Message-ID: CA+HiwqFQS8v2TgUzwKKQtX482P42bn=ETx-eBQVEg+fRXQd8pg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Mar 18, 2024 at 8:57 PM Ashutosh Bapat
<ashutosh(dot)bapat(dot)oss(at)gmail(dot)com> wrote:
> On Mon, Mar 18, 2024 at 5:05 PM Amit Langote <amitlangote09(at)gmail(dot)com> wrote:
>> On Mon, Mar 18, 2024 at 20:11 Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com> wrote:
>>> On Fri, Mar 15, 2024 at 11:45 AM Amit Langote <amitlangote09(at)gmail(dot)com> wrote:
>>>> Could you please post the numbers with the palloc() / pfree() version?
>>>
>>> Here are they
>>> tables | master | patched
>>> --------+---------+---------
>>> 2 | 29 MB | 28 MB
>>> 3 | 102 MB | 93 MB
>>> 4 | 307 MB | 263 MB
>>> 5 | 1076 MB | 843 MB
>>>
>>> The numbers look slightly different from my earlier numbers. But they were quite old. The patch used to measure memory that time is different from the one that we committed. So there's a slight difference in the way we measure memory as well.
>>
>>
>> Sorry, I should’ve mentioned that I was interested in seeing cpu times to compare the two approaches. Specifically, to see if the palloc / frees add noticeable overhead.
>
> No problem. Here you go
>
> tables | master | patched | perc_change
> --------+----------+----------+-------------
> 2 | 477.87 | 492.32 | -3.02
> 3 | 1970.83 | 1989.52 | -0.95
> 4 | 6305.01 | 6268.81 | 0.57
> 5 | 19261.56 | 18684.86 | 2.99
>
> +ve change indicates reduced planning time. It seems that the planning time improves as the number of tables increases. But all the numbers are well within noise levels and thus may not show any improvement or deterioration. If you want, I can repeat the experiment.

Thanks. I also wanted to see cpu time difference between the two
approaches of SpecialJoinInfo allocation -- on stack and on heap. So
comparing times with the previous version of the patch using stack
allocation and the new one with palloc. I'm hoping that the new
approach is only worse in the noise range.

--
Thanks, Amit Langote

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2024-03-18 12:10:28 Re: BitmapHeapScan streaming read user and prelim refactoring
Previous Message Ashutosh Bapat 2024-03-18 11:56:52 Re: Memory consumed by child SpecialJoinInfo in partitionwise join planning