Tom Lane <t...@sss.pgh.pa.us> wrote: > Hitoshi Harada <umi.tan...@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
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers