Re: IndexJoin memory problem using spgist and boxes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Anton Dignös <dignoes(at)inf(dot)unibz(dot)it>
Cc: Alexander Kuzmenkov <a(dot)kuzmenkov(at)postgrespro(dot)ru>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: IndexJoin memory problem using spgist and boxes
Date: 2018-03-04 19:46:22
Message-ID: 26107.1520192782@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

=?UTF-8?Q?Anton_Dign=C3=B6s?= <dignoes(at)inf(dot)unibz(dot)it> writes:
>> Looking at the patch, I see that you changed the lifetime of the temporary
>> context from per-tuple to per-index-scan. It is not obvious that this change
>> is correct.

> The problem before this patch was that the traversalMemoryContext in
> this function was set to per-query lifetime.
> The memory allocations in the per-query lifetime caused this high
> memory consumption.

Yeah ...

> I changed the temporary context to per-index-scan so that it can also
> be used for traversalMemoryContext.

But we have also had many complaints about leakage across a single index
scan, if it traverses many index entries. I think you're just moving the
pain out of one use-case and into another.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2018-03-04 20:17:50 Re: [HACKERS] user-defined numeric data types triggering ERROR: unsupported type
Previous Message Tom Lane 2018-03-04 19:37:15 Re: [HACKERS] user-defined numeric data types triggering ERROR: unsupported type