Re: Export user visible function to make use of convert_to_scalar

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Export user visible function to make use of convert_to_scalar
Дата
Msg-id 6127.1185913150@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Export user visible function to make use of convert_to_scalar  (Gregory Stark <stark@enterprisedb.com>)
Ответы Re: Export user visible function to make use of convert_to_scalar
Список pgsql-patches
Gregory Stark <stark@enterprisedb.com> writes:
> "Tom Lane" <tgl@sss.pgh.pa.us> writes:
>> How so?  The entries in the histogram are equidistant by definition.

> Huh? They have equal number of values between them, they're not equidistant in
> the scalar space. So the area of each bar should be the same but the width
> would be proportional to the width of the bucket and the height inversely
> proportional.

You're presuming there exists a linear scalar space to reference the
results to.  I'm unconvinced that that's a good assumption to make.
Consider for instance a column of URLs; practically all the entries will
start with http or ftp or one of a small number of other possibilities.
If you try to represent this with some hypothetical linear x-axis you
are going to produce an unusable display.

convert_to_scalar partially avoids this problem because of the way it's
used within the backend: we don't actually assume that there is any
global linear space, only that the values within any single histogram
bucket are fairly uniformly distributed.  (This assumption tends to
become true in the limit as the buckets get smaller, even if the global
distribution is pretty crazy.  And even if it doesn't become true, the
absolute error is bounded by the bucket size.)  You can't use the thing
to measure the "positions" of histogram boundary values, because those
are part of its frame of reference not something it outputs.

            regards, tom lane

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

Предыдущее
От: Gregory Stark
Дата:
Сообщение: Re: Export user visible function to make use of convert_to_scalar
Следующее
От: Gregory Stark
Дата:
Сообщение: Re: Export user visible function to make use of convert_to_scalar