From:
Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To:
Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
Cc:
PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, David Fetter <david(at)fetter(dot)org>
Subject:
Re: wip: functions median and percentile
Date:
2010-09-22 04:44:58
Message-ID:
AANLkTik__bHQ8huADCpuN63w0eKdWnNHq0nSXdQ27R9N@mail.gmail.com (view raw or flat )
Thread:
2010-08-19 10:59:33 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2010-08-19 14:50:23 from Greg Stark <gsstark(at)mit(dot)edu>
2010-08-19 15:33:13 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-08-19 16:49:45 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-08-19 17:03:20 from David Fetter <david(at)fetter(dot)org>
2010-08-19 17:12:12 from "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
2010-08-19 17:14:58 from David Fetter <david(at)fetter(dot)org>
2010-08-19 17:25:36 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-08-19 17:47:59 from David Fetter <david(at)fetter(dot)org>
2010-08-19 18:17:42 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-08-19 17:41:57 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2010-08-19 18:17:28 from "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
2010-08-19 17:38:14 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2010-09-20 03:47:09 from Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
2010-09-20 05:11:02 from David Fetter <david(at)fetter(dot)org>
2010-09-20 06:22:29 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2010-09-21 20:28:15 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2010-09-21 20:44:16 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-09-21 21:03:31 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2010-09-22 02:21:01 from Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
2010-09-22 04:36:24 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2010-09-22 03:06:51 from Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
2010-09-22 04:44:58 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2010-09-23 09:35:47 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2010-09-23 17:45:36 from Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
2010-09-23 18:27:38 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2010-09-23 18:48:47 from David Fetter <david(at)fetter(dot)org>
2010-09-23 18:56:53 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2010-09-26 10:39:21 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2010-10-01 08:17:19 from Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
2010-10-01 08:46:45 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2010-10-01 13:05:43 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-10-01 13:19:57 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2010-10-01 14:11:08 from Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
2010-10-01 14:43:47 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-10-01 15:00:35 from Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
2010-10-01 15:08:00 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-10-01 15:15:03 from "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
2010-10-01 15:35:03 from Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
2010-10-01 15:16:03 from Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
2010-10-01 15:22:46 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-10-01 15:32:03 from Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
2010-10-01 17:37:03 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2010-10-01 19:17:08 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2010-10-03 14:06:25 from Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
2010-10-03 15:49:37 from Greg Stark <gsstark(at)mit(dot)edu>
2010-10-04 06:36:48 from Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
2010-10-04 06:58:44 from Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
2010-10-04 16:14:06 from Greg Stark <gsstark(at)mit(dot)edu>
2010-10-04 17:22:39 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-10-04 19:20:28 from Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
2010-10-05 06:04:31 from Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
2010-10-05 08:47:52 from Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
2010-10-05 12:14:24 from Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
2010-10-05 13:08:59 from Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
2010-10-10 21:16:59 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-10-11 06:58:53 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2010-10-11 09:35:13 from Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
2010-10-11 09:55:16 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2010-10-11 10:33:11 from Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
2010-10-11 14:03:40 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-10-11 15:30:46 from Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
2010-10-11 15:44:08 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-10-11 17:34:51 from Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
2010-10-11 17:37:11 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-10-11 17:42:10 from Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
2010-10-11 17:48:12 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-10-11 17:55:32 from Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
2010-10-11 18:05:11 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-10-11 18:23:25 from Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
2010-10-11 10:33:12 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-10-11 14:08:53 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-10-11 14:29:38 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-10-11 18:27:13 from Greg Stark <gsstark(at)mit(dot)edu>
2010-10-11 18:30:39 from Josh Berkus <josh(at)agliodbs(dot)com>
2010-10-11 18:46:47 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2010-10-12 03:08:32 from Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
2010-10-12 08:44:20 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2010-10-13 10:36:59 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2010-10-13 10:48:17 from Peter Eisentraut <peter_e(at)gmx(dot)net>
2010-10-13 10:51:51 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2010-10-13 10:56:06 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2010-10-14 00:54:42 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-10-14 02:37:37 from Greg Stark <gsstark(at)mit(dot)edu>
2010-10-14 12:17:54 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-10-14 04:53:57 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2010-10-03 17:31:18 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2010-10-01 14:44:44 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-09-23 13:22:39 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2010-09-23 13:25:32 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Lists:
pgsql-hackers pgsql-rrreviewers
2010/9/22 Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>:
> 2010/9/22 Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>:
>> Hello
>>
>> I found probably hard problem in cooperation with window functions :(
>>
>> tuplesort_begin_datum creates child context inside aggcontext. This
>> context is used for tuplestore. But when this function is called from
>> WindowAgg_Aggregates context - someone drops all child context every
>> iteration, and then tuplestore state is invalid. For this moment we
>> can block using a median function as window function, but it should be
>> solved better - if it is possible - I don't see inside window function
>> implementation.
>
> Does it happen when the window frame starts from not UNBOUNDED
> PRECEDING? In those cases, nodeWindowAgg tries to discard all
> aggregate contexts and to initialize the aggregate state. AFAIK the
> memory context is brand-new although it was reset and its children
> deleted, so if the function is well-formed and initializes its state
> on NULL input, it doesn't cause a problem.
>
It is bad premise. Inside a aggregates I don't have a control over
memory context. There missing one level of persistent memory context
where I can put a child context - but this context should be created
outside - some like group context.
Pavel
>
> Regards,
>
>
> --
> Hitoshi Harada
>
In response to
pgsql-hackers by date
Next :From: David E. WheelerDate: 2010-09-22 04:46:03
Subject : Re: Multi-branch committing in git, revisited
Previous :From : Jesper KroghDate : 2010-09-22 04:41:01
Subject : Re: Make tuples_per_page pr. table configureable.
pgsql-rrreviewers by date
Next :From: Marko TiikkajaDate: 2010-09-22 23:59:15
Subject : Re: top-level DML under CTEs
Previous :From : Pavel StehuleDate : 2010-09-22 04:36:24
Subject : Re: wip: functions median and percentile