Re: Index-only scans for GiST.

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: hlinnaka(at)iki(dot)fi, Anastasia Lubennikova <lubennikovaav(at)gmail(dot)com>
Cc: Fabrízio Mello <fabriziomello(at)gmail(dot)com>, Thom Brown <thom(at)linux(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Index-only scans for GiST.
Date: 2015-03-26 17:16:21
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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.

> 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2015-03-26 17:50:24 Re: Error with index on unlogged table
Previous Message hitesh ramani 2015-03-26 17:14:35 trying to study how sorting works