Re: wip: functions median and percentile

Поиск
Список
Период
Сортировка
Искать
От
Robert Haas
Тема
Re: wip: functions median and percentile
Дата
Msg-id
AANLkTin4_YZRE1ze+4tD4CBQPU4bF2vWvyQquC5i1odL@mail.gmail.com
Ответ на
Список
Дерево обсуждения
wip: functions median and percentile Pavel Stehule <pavel.stehule@gmail.com>
Re: wip: functions median and percentile Hitoshi Harada <umi.tanuki@gmail.com>
Re: wip: functions median and percentile Pavel Stehule <pavel.stehule@gmail.com>
Re: wip: functions median and percentile Robert Haas <robertmhaas@gmail.com>
Re: wip: functions median and percentile Pavel Stehule <pavel.stehule@gmail.com>
Re: wip: functions median and percentile Hitoshi Harada <umi.tanuki@gmail.com>
Re: wip: functions median and percentile Pavel Stehule <pavel.stehule@gmail.com>
Re: wip: functions median and percentile Hitoshi Harada <umi.tanuki@gmail.com>
Re: wip: functions median and percentile Pavel Stehule <pavel.stehule@gmail.com>
Re: wip: functions median and percentile Pavel Stehule <pavel.stehule@gmail.com>
Re: wip: functions median and percentile Hitoshi Harada <umi.tanuki@gmail.com>
Re: wip: functions median and percentile Pavel Stehule <pavel.stehule@gmail.com>
Re: wip: functions median and percentile David Fetter <david@fetter.org>
Re: wip: functions median and percentile Pavel Stehule <pavel.stehule@gmail.com>
Re: wip: functions median and percentile Pavel Stehule <pavel.stehule@gmail.com>
Re: wip: functions median and percentile Hitoshi Harada <umi.tanuki@gmail.com>
Re: wip: functions median and percentile Tom Lane <tgl@sss.pgh.pa.us>
Re: wip: functions median and percentile Hitoshi Harada <umi.tanuki@gmail.com>
Re: wip: functions median and percentile Tom Lane <tgl@sss.pgh.pa.us>
Re: wip: functions median and percentile Hitoshi Harada <umi.tanuki@gmail.com>
Re: wip: functions median and percentile Tom Lane <tgl@sss.pgh.pa.us>
Re: wip: functions median and percentile "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Re: wip: functions median and percentile Hitoshi Harada <umi.tanuki@gmail.com>
Re: wip: functions median and percentile Hitoshi Harada <umi.tanuki@gmail.com>
Re: wip: functions median and percentile Tom Lane <tgl@sss.pgh.pa.us>
Re: wip: functions median and percentile Hitoshi Harada <umi.tanuki@gmail.com>
Re: wip: functions median and percentile Pavel Stehule <pavel.stehule@gmail.com>
Re: wip: functions median and percentile Pavel Stehule <pavel.stehule@gmail.com>
Re: wip: functions median and percentile Hitoshi Harada <umi.tanuki@gmail.com>
Re: wip: functions median and percentile Pavel Stehule <pavel.stehule@gmail.com>
Re: wip: functions median and percentile Greg Stark <gsstark@mit.edu>
Re: wip: functions median and percentile Hitoshi Harada <umi.tanuki@gmail.com>
Re: wip: functions median and percentile Dean Rasheed <dean.a.rasheed@gmail.com>
Re: wip: functions median and percentile Robert Haas <robertmhaas@gmail.com>
Re: wip: functions median and percentile Dean Rasheed <dean.a.rasheed@gmail.com>
Re: wip: functions median and percentile Hitoshi Harada <umi.tanuki@gmail.com>
Re: wip: functions median and percentile Dean Rasheed <dean.a.rasheed@gmail.com>
Re: wip: functions median and percentile Hitoshi Harada <umi.tanuki@gmail.com>
Re: wip: functions median and percentile Dean Rasheed <dean.a.rasheed@gmail.com>
Re: wip: functions median and percentile Tom Lane <tgl@sss.pgh.pa.us>
Re: wip: functions median and percentile Pavel Stehule <pavel.stehule@gmail.com>
Re: wip: functions median and percentile Dean Rasheed <dean.a.rasheed@gmail.com>
Re: wip: functions median and percentile Tom Lane <tgl@sss.pgh.pa.us>
Re: wip: functions median and percentile Dean Rasheed <dean.a.rasheed@gmail.com>
Re: wip: functions median and percentile Tom Lane <tgl@sss.pgh.pa.us>
Re: wip: functions median and percentile Dean Rasheed <dean.a.rasheed@gmail.com>
Re: wip: functions median and percentile Tom Lane <tgl@sss.pgh.pa.us>
Re: wip: functions median and percentile Dean Rasheed <dean.a.rasheed@gmail.com>
Re: wip: functions median and percentile Tom Lane <tgl@sss.pgh.pa.us>
Re: wip: functions median and percentile Dean Rasheed <dean.a.rasheed@gmail.com>
Re: wip: functions median and percentile Tom Lane <tgl@sss.pgh.pa.us>
Re: wip: functions median and percentile Dean Rasheed <dean.a.rasheed@gmail.com>
Re: wip: functions median and percentile Pavel Stehule <pavel.stehule@gmail.com>
Re: wip: functions median and percentile Dean Rasheed <dean.a.rasheed@gmail.com>
Re: wip: functions median and percentile Robert Haas <robertmhaas@gmail.com>
Re: wip: functions median and percentile Tom Lane <tgl@sss.pgh.pa.us>
Re: wip: functions median and percentile Robert Haas <robertmhaas@gmail.com>
Re: wip: functions median and percentile Greg Stark <gsstark@mit.edu>
Re: wip: functions median and percentile Josh Berkus <josh@agliodbs.com>
Re: wip: functions median and percentile Pavel Stehule <pavel.stehule@gmail.com>
Re: wip: functions median and percentile Peter Eisentraut <peter_e@gmx.net>
Re: wip: functions median and percentile Pavel Stehule <pavel.stehule@gmail.com>
Re: wip: functions median and percentile Pavel Stehule <pavel.stehule@gmail.com>
Re: wip: functions median and percentile Robert Haas <robertmhaas@gmail.com>
Re: wip: functions median and percentile Pavel Stehule <pavel.stehule@gmail.com>
Re: wip: functions median and percentile Greg Stark <gsstark@mit.edu>
Re: wip: functions median and percentile Robert Haas <robertmhaas@gmail.com>
Re: wip: functions median and percentile Hitoshi Harada <umi.tanuki@gmail.com>
Re: wip: functions median and percentile Pavel Stehule <pavel.stehule@gmail.com>
Re: wip: functions median and percentile Pavel Stehule <pavel.stehule@gmail.com>
Re: wip: functions median and percentile Greg Stark <gsstark@mit.edu>
Re: wip: functions median and percentile Robert Haas <robertmhaas@gmail.com>
Re: wip: functions median and percentile Pavel Stehule <pavel.stehule@gmail.com>
Re: wip: functions median and percentile Pavel Stehule <pavel.stehule@gmail.com>
Re: wip: functions median and percentile Pavel Stehule <pavel.stehule@gmail.com>
Re: wip: functions median and percentile Pavel Stehule <pavel.stehule@gmail.com>
Re: wip: functions median and percentile Greg Stark <gsstark@mit.edu>
Re: wip: functions median and percentile Tom Lane <tgl@sss.pgh.pa.us>
Re: wip: functions median and percentile Robert Haas <robertmhaas@gmail.com>
Re: wip: functions median and percentile David Fetter <david@fetter.org>
Re: wip: functions median and percentile "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Re: wip: functions median and percentile David Fetter <david@fetter.org>
Re: wip: functions median and percentile Tom Lane <tgl@sss.pgh.pa.us>
Re: wip: functions median and percentile David Fetter <david@fetter.org>
Re: wip: functions median and percentile Tom Lane <tgl@sss.pgh.pa.us>
Re: wip: functions median and percentile Pavel Stehule <pavel.stehule@gmail.com>
Re: wip: functions median and percentile "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Re: wip: functions median and percentile Pavel Stehule <pavel.stehule@gmail.com>
On Mon, Oct 11, 2010 at 10:08 AM, Tom Lane  wrote:
> Robert Haas  writes:
>> On Sun, Oct 10, 2010 at 5:16 PM, Tom Lane  wrote:
>>> It was pointed out upthread that while median isn't presently
>>> in the standard, Oracle defines it in terms of percentile_cont(0.5)
>>> which *is* in the standard.  What I read in SQL:2008 is that
>>> percentile_cont is defined for all numeric types (returning
>>> approximate numeric with implementation-defined precision),
>>> and for interval (returning interval), and not for any other
>>> input type.  So it appears to me that what we ought to support
>>> is
>>>        median(float8) returns float8
>>>        median(interval) returns interval
>>> and nothing else --- we can rely on implicit casting to convert
>>> any other numeric input type to float8.
>
>> Isn't there a possibility of a precision loss if numeric gets cast to
>> float8?
>
> So?  The standard says "implementation-defined precision".  We can
> define it as giving results that are good to float8.  I find it hard to
> imagine an application for median() where that's not good enough;
> and what's more, the difference in comparison speed between float8 and
> numeric would render median() on numeric pretty useless anyway.

I suppose for most applications it won't matter; I just hate losing
precision, and have a deep skepticism of floats, as we've discussed
previously.  :-)

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

В списке pgsql-hackers по дате отправления
От: Magnus Hagander
Дата:
От: Tom Lane
Дата:
FAQ