Re: TABLESAMPLE patch is really in pretty sad shape

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: TABLESAMPLE patch is really in pretty sad shape
Дата
Msg-id 13943.1437660067@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: TABLESAMPLE patch is really in pretty sad shape  (Petr Jelinek <petr@2ndquadrant.com>)
Ответы Re: TABLESAMPLE patch is really in pretty sad shape  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Petr Jelinek <petr@2ndquadrant.com> writes:
> On 2015-07-23 02:01, Tom Lane wrote:
>> This needs to work more like LIMIT, which doesn't try to compute the
>> limit parameters until the first fetch.  So what we need is an Init
>> function that does very darn little indeed (maybe we don't even need
>> it at all), and then a ParamInspect function that is called at first fetch
>> or during a ReScan, and that one is the one that gets to look at the
>> evaluated parameter values.

> If we replace the Begin and ReScan interfaces by single interface the 
> Init would definitely be optional (all it would do so far is palloc the 
> tsmdata which can be done easily in the new interface if tsmdata is 
> NULL). I don't like the ParamInspect name as that function needs to 
> setup the state for the sampling method (and that's true no matter if we 
> have Init or not), I think something like BeginScan works better, but it 
> must be clearly documented that it's called for ReScan as well.

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.
        regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Fabien COELHO
Дата:
Сообщение: Re: extend pgbench expressions with functions
Следующее
От: Michael Paquier
Дата:
Сообщение: Several memory leaks for pg_rewind caused by missing PQclear calls