Re: wip: functions median and percentile
От | Kevin Grittner |
---|---|
Тема | Re: wip: functions median and percentile |
Дата | |
Msg-id | 4CA5B4A70200002500036331@gw.wicourts.gov обсуждение исходный текст |
Ответ на | Re: wip: functions median and percentile (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: wip: functions median and percentile
|
Список | pgsql-hackers |
Tom Lane <tgl@sss.pgh.pa.us> wrote: > Hitoshi Harada <umi.tanuki@gmail.com> writes: >> Another suggestion? > > The implementation I would've expected to see is to do the sort > and then have two code paths for retrieving the median, depending > on whether the sort result is all in memory or not. Would it make sense to accumulate value/count pairs in a hash table, along with a total count, as the tuples are encountered, and sort the (potentially smaller) hash table at the end? (Not that this helps with the memory management questions...) Large sets with any significant degree of duplication in values (say the age in years of residents of a state) would probably run significantly faster this way. -Kevin
В списке pgsql-hackers по дате отправления: