Re: IndexJoin memory problem using spgist and boxes

From: Anton Dignös <dignoes(at)inf(dot)unibz(dot)it>
To: Alexander Kuzmenkov <a(dot)kuzmenkov(at)postgrespro(dot)ru>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: IndexJoin memory problem using spgist and boxes
Date: 2018-03-06 10:41:58
Message-ID: CALNdv1jAuoN3NeSR0Y3YOVSe9pW5dWcVvQ8bxYxJSxeBS3GHAQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>> The better alternative may be to have two temporary memory contexts,
>> one per-tuple for calling the inner consistent method and one
>> per-index-scan for the traversal memory.
>
>
> Yes, this seems to be a better way of fixing the problem without introducing
> regressions mentioned by Tom. We'd keep a separate traversal context in
> ScanOpaque and run most of the spgWalk in it, except calling storeRes in
> query context and the inner consistent method in short-lived context.

Thanks to both for the feedback.
I will work on that and come back to you.

>
> Also, I think it would be worthwhile to test the resulting patch with
> valgrind. The allocations are not very apparent in the code, so it's easy to
> miss something.
>

I tried with valgrind in the first place and didn't see any suspicious
memory leaks but I will give it another try.

Best regards,
Anton

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Etsuro Fujita 2018-03-06 11:09:50 Re: [HACKERS] Another oddity in handling of WCO constraints in postgres_fdw
Previous Message Jeevan Chalke 2018-03-06 10:31:35 Re: [HACKERS] Partition-wise aggregation/grouping