Re: TABLESAMPLE patch is really in pretty sad shape

From: Petr Jelinek <petr(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: TABLESAMPLE patch is really in pretty sad shape
Date: 2015-07-23 23:55:55
Message-ID: 55B17F0B.6040600@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2015-07-24 01:26, Petr Jelinek wrote:
> 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.
>

Ok, attached are couple of cosmetic changes - what I wrote above, plus
comment about why we do float8 + hashing for REPEATABLE (it's not
obvious IMHO) and one additional test query.

Do you want to do the contrib changes yourself as well or should I take it?

--
Petr Jelinek http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachment Content-Type Size
tsm-fixes-pj.diff text/x-diff 6.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message dinesh kumar 2015-07-24 00:15:50 Re: Proposing COPY .. WITH PERMISSIVE
Previous Message Petr Jelinek 2015-07-23 23:26:45 Re: TABLESAMPLE patch is really in pretty sad shape