Skip site navigation (1) Skip section navigation (2)

Re: wip: functions median and percentile

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>, Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>, David Fetter <david(at)fetter(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: wip: functions median and percentile
Date: 2010-10-14 12:17:54
Message-ID: AANLkTik6jLcowOMAPg-L_qWLUyaUrHgzoAxWp6++otw0@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-rrreviewers
On Wed, Oct 13, 2010 at 10:37 PM, Greg Stark <gsstark(at)mit(dot)edu> wrote:
> On Wed, Oct 13, 2010 at 5:54 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>> Or to put it more bluntly - what is the "problem with planner and hash
>> agg" that all of these functions need to solve?  And why does it need
>> a flag in pg_proc?  Why can't't we leave it to the individual
>> functions to perform a sort of one is needed?
>>
>
> So I think that's backwards. Why is the function doing data
> manipulations like sorts that we usually put in the plan? Is there
> some some key meta information that should be flagged in pg_proc and
> general functionality the executor should be providing so that this
> general class of problems can be solved efficiently?
>
> Otherwise I fear lots of things we would expect to be efficient such
> as calculating the top, median, and last items in the same sort order
> would require three separate sorts of the same data. We have a planner
> capable of comparing sort orders and estimating the costs of different
> plans, we should be using it.

Good point.  I think you're right.  I'm not sure what the best design
for it is, though.

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

In response to

pgsql-hackers by date

Next:From: Robert HaasDate: 2010-10-14 12:19:07
Subject: Re: Issues with Quorum Commit
Previous:From: Dmitriy IgrishinDate: 2010-10-14 12:14:04
Subject: Re: querying the version of libpq

pgsql-rrreviewers by date

Next:From: Greg SmithDate: 2010-11-13 00:08:15
Subject: CommitFest 2010-11: Call for Reviewers
Previous:From: Pavel StehuleDate: 2010-10-14 04:53:57
Subject: Re: wip: functions median and percentile

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group