On 03/02/2015 12:43 AM, Heikki Linnakangas wrote:
> On 02/27/2015 04:19 PM, Anastasia Lubennikova wrote:
>> I add MemoryContext listCxt to avoid memory leak. listCxt is created once
>> in gistrescan (only for index-only scan plan ) and reseted when scan of the
>> leaf page is finished.
>>
>> I do not sure if the problem was completely solved, so I wait for feedback.
>
> Yeah, I think that solves it.
On further testing, there was actually still a leak with kNN-searches.
Fixed.
> I spent a little time cleaning this up. I reverted that pageData change
> so that it's an array again, put back the gist_indexonly.sql and
> expected output files that were missing from your latest version,
> removed a couple of unused local variables that gcc complained about. I
> refactored gistFetchTuple a bit, because it was doing IMHO quite bogus
> things with NULLs. It was passing NULLs to the opclass' fetch function,
> but it didn't pass the isNull flag correctly. I changed it so that the
> fetch function is not called at all for NULLs.
>
> I think this is pretty close to being committable. I'll make a round of
> editorializing over the docs, and the code comments as well.
>
> The opr_sanity regression test is failing, there's apparently something
> wrong with the pg_proc entries of the *canreturn functions. I haven't
> looked into that yet; could you fix that?
I have pushed this, after fixing the opr_sanity failure, some bug fixes,
and documentation and comment cleanup.
Thanks for the patch!
- Heikki