Re: Re: sampling.c and potential divisions by 0 ang log(0) with tablesample and ANALYZE in 9.5
От
Tom Lane
Тема
Re: Re: sampling.c and potential divisions by 0 ang log(0) with tablesample and ANALYZE in 9.5
Дата
Msg-id
6412.1435681288@sss.pgh.pa.us
Ответ на
Re: Re: sampling.c and potential divisions by 0 ang log(0) with tablesample and ANALYZE in 9.5 (Tom Lane)
Список
Дерево обсуждения
sampling.c and potential divisions by 0 ang log(0) with tablesample
and ANALYZE in 9.5 Michael Paquier <michael.paquier@gmail.com>
Re: sampling.c and potential divisions by 0 ang log(0) with tablesample
and ANALYZE in 9.5 Petr Jelinek <petr@2ndquadrant.com>
Re: Re: sampling.c and potential divisions by 0 ang log(0) with tablesample and ANALYZE in 9.5 Tom Lane <tgl@sss.pgh.pa.us>
Re: Re: sampling.c and potential divisions by 0 ang log(0) with tablesample and ANALYZE in 9.5 Tom Lane <tgl@sss.pgh.pa.us>
Re: Re: sampling.c and potential divisions by 0 ang log(0)
with tablesample and ANALYZE in 9.5 Petr Jelinek <petr@2ndquadrant.com>
Re: Re: sampling.c and potential divisions by 0 ang log(0) with tablesample and ANALYZE in 9.5 Tom Lane <tgl@sss.pgh.pa.us>
Re: Re: sampling.c and potential divisions by 0 ang log(0)
with tablesample and ANALYZE in 9.5 Petr Jelinek <petr@2ndquadrant.com>
Re: Re: sampling.c and potential divisions by 0 ang log(0)
with tablesample and ANALYZE in 9.5 Michael Paquier <michael.paquier@gmail.com>
Re: Re: sampling.c and potential divisions by 0 ang log(0)
with tablesample and ANALYZE in 9.5 Petr Jelinek <petr@2ndquadrant.com>
Re: Re: sampling.c and potential divisions by 0 ang log(0)
with tablesample and ANALYZE in 9.5 Michael Paquier <michael.paquier@gmail.com>
Re: Re: sampling.c and potential divisions by 0 ang log(0)
with tablesample and ANALYZE in 9.5 Michael Paquier <michael.paquier@gmail.com>
Re: sampling.c and potential divisions by 0 ang log(0) with
tablesample and ANALYZE in 9.5 Michael Paquier <michael.paquier@gmail.com>
I wrote:
> Petr Jelinek writes:
>> On 2015-06-25 10:01, Michael Paquier wrote:
>>> I think that we should change the returned double to be (0.0,1.0]
>> Agreed.
> I find this to be a pretty bad idea. That definition is simply weird;
> where else in the world will you find a random number generator that does
> that? What are the odds that any callers are actually designed for that
> behavior?
And, in fact, a bit of looking quickly finds a counterexample, in
analyze.c:
int k = (int) (targrows * sampler_random_fract(rstate.randstate));
Assert(k >= 0 && k < targrows);
You can't just whack this around to satisfy some new call sites without
considering the behavior of existing use-cases.
regards, tom laneВ списке pgsql-bugs по дате отправления
От: Tom Lane
Дата:
От: Petr Jelinek
Дата: