Re: wip: functions median and percentile - Mailing list pgsql-hackers

From Tom Lane
Subject Re: wip: functions median and percentile
Date
Msg-id 25774.1285938343@sss.pgh.pa.us
Whole thread Raw
In response to Re: wip: functions median and percentile  (Hitoshi Harada <umi.tanuki@gmail.com>)
Responses Re: wip: functions median and percentile
Re: wip: functions median and percentile
List pgsql-hackers
Hitoshi Harada <umi.tanuki@gmail.com> writes:
> 2010/9/26 Pavel Stehule <pavel.stehule@gmail.com>:
>> This patch needs a few work - can share a compare functionality with
>> tuplesort.c, but I would to verify a concept now.

> Sorry for delay. I read the patch and it seems the result is sane. For
> window function calls, I agree that the current tuplesort is not
> enough to implement median functions and the patch introduces its own
> memsort mechanism, although memsort has too much copied from
> tuplesort. It looks to me not so difficult to modify the existing
> tuplesort to guarantee staying in memory always if an option to do so
> is specified from caller. I think that option can be used by other
> cases in the core code.

If this patch tries to force the entire sort to happen in memory,
it is not committable.  What will happen when you get a lot of data?
You need to be working on a variant that will work anyway, not working
on an unacceptable lobotomization of the main sort code.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: recovery.conf location
Next
From: Pavel Stehule
Date:
Subject: Re: wip: functions median and percentile