On Sun, Oct 3, 2010 at 7:06 AM, Hitoshi Harada <umi.tan...@gmail.com> wrote: > And I'm now thinking about how to make median happen in window > aggregate.
If you were to do this by extending tuplesort what extra features would tuplesort need? Would tuplesort need the ability to insert additional records into an already sorted array and maintain the sort? Would it need the ability to remove records from the sorted set? Would it need the ability to do a partial sort (the QuickSelect algorithm)? The ability to do random access on disk sets? How do existing windowed aggregates work if you specify an order by on the aggregate? Do they resort for every output row? Does the spec give a way to run an arbitrary subselect on the current window? I wonder if we need more powerful machinery anyways to handle these cases. -- greg -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers