On 2015-07-24 00:39, Tom Lane wrote:
> I wrote:
>> OK, so "InitSampleScan" for a function called at ExecInitSampleScan time
>> (which we might as well make optional), and then we'll use BeginSampleScan
>> for the function that gets the parameters. The restart/ReScan function
>> goes away since BeginSampleScan will take its place.
>
> Here's a WIP patch implementing things this way. I've also taken the time
> to do a complete code review, and fixed quite a large number of things,
> some cosmetic and some not so much. I have not yet touched the tsm
> contrib modules (so they won't even compile...), but I'm reasonably happy
> with the state of the core code now.
>
Eh, I was just writing email with my rewrite :)
I'll do review of this instead then.
The only major difference that I see so far and I'd like you to
incorporate that into your patch is that I renamed the SampleScanCost to
SampleScanGetRelSize because that reflects much better the use of it, it
isn't really used for costing, but for getting the pages and tuples of
the baserel.
-- Petr Jelinek http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training &
Services