Re: Proposal: Pre ordered aggregates, default ORDER BY clause for aggregates - median support - Mailing list pgsql-hackers

From Greg Stark
Subject Re: Proposal: Pre ordered aggregates, default ORDER BY clause for aggregates - median support
Date
Msg-id 407d949e0912201737m4c503878y8db53fbdbe317e6@mail.gmail.com
Whole thread Raw
In response to Re: Proposal: Pre ordered aggregates, default ORDER BY clause for aggregates - median support  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Responses Re: Proposal: Pre ordered aggregates, default ORDER BY clause for aggregates - median support  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
Incidentally there are O(n) algorithms for finding the median (or any
specific offset). It shouldn't be necessary to sort at all.

I'm not sure which path this argues for - perhaps Tom's position that
we need more optimiser infrastructure so we can see how to accomplish
this. Perhaps it means you should really implement median() with an
internal selection alagorithm and not depend on the optimizer at all.


-- 
greg


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Patch: Remove all declarations from pg_attribute.h, consolidate BKI scripts
Next
From: Andres Freund
Date:
Subject: Re: Patch: Remove all declarations from pg_attribute.h, consolidate BKI scripts