Re: BUG #15592: Memory overuse with subquery containing unnest() and set operations (11.x regression)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org, amdmi3(at)amdmi3(dot)ru
Subject: Re: BUG #15592: Memory overuse with subquery containing unnest() and set operations (11.x regression)
Date: 2019-01-14 16:57:55
Message-ID: 27649.1547485075@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

I wrote:
> Andres Freund <andres(at)anarazel(dot)de> writes:
>> Think I know where the problem is - let me have a coffee and check? I think I might have a good lying around...

> I had just determined that the extra context was added by bf6c614a2,

The short answer here is that this addition to BuildTupleHashTable:

hashtable->exprcontext = CreateExprContext(parent->state);

allocates memory that is not freed by freeing the hashtable's tablecxt,
breaking the API for grouping hashtables.

Why does a hashtable need its own exprcontext now when it didn't before?

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Stephen Frost 2019-01-14 17:57:31 Re: BUG #15591: pg_receivewal does not honor replication slots
Previous Message Tom Lane 2019-01-14 16:50:27 Re: BUG #15592: Memory overuse with subquery containing unnest() and set operations (11.x regression)