From: | Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> |
---|---|
To: | Robert Haas <robertmhaas(at)gmail(dot)com> |
Cc: | Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Parallel Seq Scan |
Date: | 2015-11-17 02:49:52 |
Message-ID: | CAA4eK1+2uddzzA=zSsQWh9m6QevgHD4a0ZyxHmjmUKTrmWd-DA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Mon, Nov 16, 2015 at 7:39 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Sun, Nov 15, 2015 at 1:12 AM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
wrote:
> > Thanks for the report.
> >
> > I think main reason of the leak in workers seems to be due the reason
> > that one of the buffer used while sending tuples (in function
> > BuildRemapInfo)
> > from worker to master is not getting freed and it is allocated for each
> > tuple worker sends back to master. I couldn't find use of such a
buffer,
> > so I think we can avoid the allocation of same or atleast we need to
free
> > it. Attached patch remove_unused_buf_allocation_v1.patch should fix the
> > issue.
>
> Oops. Committed.
>
Thanks!
> > Another thing I have noticed is that we need to build the remap info
> > target list contains record type of attrs, so ideally it should not
even go
> > in
> > this path when such attrs are not present. The reason for the same was
> > that the tuple descriptor stored in TQueueDestReceiver was not updated,
> > attached patch fix_initialization_tdesc_v1 fixes this issue.
>
> I don't understand this part.
>
The code in question is as below:
tqueueReceiveSlot(TupleTableSlot *slot, DestReceiver *self)
{
..
if (tqueue->tupledesc != tupledesc ||
tqueue->remapinfo->natts != tupledesc->natts)
{
if (tqueue->remapinfo != NULL)
pfree(tqueue->remapinfo);
tqueue->remapinfo = BuildRemapInfo(tupledesc);
}
..
}
Here the above check always passes as tqueue->tupledesc is not
set due to which it always try to build remap info. Is there any reason
for doing so?
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com
From | Date | Subject | |
---|---|---|---|
Next Message | Amit Kapila | 2015-11-17 02:51:14 | Re: Parallel Seq Scan |
Previous Message | Kouhei Kaigai | 2015-11-17 02:03:04 | Re: CustomScan in a larger structure (RE: CustomScan support on readfuncs.c) |