Re: [PATCH] distinct aggregates within a window function WIP

2021-05-13 Thread Eugen Konkov
I resolve my problem https://stackoverflow.com/a/67167595/4632019: Could it be possible PG will use `filter` trick when DISTINCT is used: `sum (distinct suma)`? This will benefit to not write second SELECT https://www.postgresql.org/message-id/CAN1PwonqojSAP_N91zO5Hm7Ta4Mdib-2YuUaEd0NP6Fn6Xutz

Re: [PATCH] distinct aggregates within a window function WIP

2020-09-16 Thread Michael Paquier
On Wed, Sep 16, 2020 at 11:35:22AM +0300, Krasiyan Andreev wrote: > I am thinking also to concentrate on Vik's patch, if it has a clear design > point of view, clear design, I can withdraw mine patch. Okay, I have done that then. -- Michael signature.asc Description: PGP signature

Re: [PATCH] distinct aggregates within a window function WIP

2020-09-16 Thread Krasiyan Andreev
Thank you very much. I think that Vik Fearing's patch about "Implement for window functions" is much clear, better and has a chance to be committed. For me it's not important which patch will go into PostgreSQL, because it's a much needed feature. In mine patch, there is also a feature about usi

Re: [PATCH] distinct aggregates within a window function WIP

2020-09-16 Thread Surafel Temesgen
On Thu, Mar 5, 2020 at 4:17 AM Krasiyan Andreev wrote: > I have currently suspended development of this patch, based on it's > review, > but I will continue development of the other Oliver Ford's work about > adding support of respect/ignore nulls > for lag(),lead(),first_value(),last_value() and

Re: [PATCH] distinct aggregates within a window function WIP

2020-04-22 Thread Eugen Konkov
Hello Andreas, Tuesday, April 21, 2020, 6:17:00 PM, you wrote: > On 4/21/20 5:06 PM, Eugen Konkov wrote: >> Hi. I read the thread. >> >> Probably this fiddle will be helpful for testing: >> >> https://dbfiddle.uk/?rdbms=postgres_12&fiddle=abe845142a5099d921d3729043fb8491 >> >> I recently encou

Re: [PATCH] distinct aggregates within a window function WIP

2020-04-21 Thread Andreas Karlsson
On 4/21/20 5:06 PM, Eugen Konkov wrote: Hi. I read the thread. Probably this fiddle will be helpful for testing: https://dbfiddle.uk/?rdbms=postgres_12&fiddle=abe845142a5099d921d3729043fb8491 I recently encountered a problem: Why Window-specific functions do not allow DISTINCT to be used withi

[PATCH] distinct aggregates within a window function WIP

2020-04-21 Thread Eugen Konkov
Hi. I read the thread. Probably this fiddle will be helpful for testing: https://dbfiddle.uk/?rdbms=postgres_12&fiddle=abe845142a5099d921d3729043fb8491 I recently encountered a problem: Why Window-specific functions do not allow DISTINCT to be used within the function argument list? sum( DIST

Re: [PATCH] distinct aggregates within a window function WIP

2020-03-04 Thread Krasiyan Andreev
I have currently suspended development of this patch, based on it's review, but I will continue development of the other Oliver Ford's work about adding support of respect/ignore nulls for lag(),lead(),first_value(),last_value() and nth_value() and from first/last for nth_value() patch, but I am no

Re: [PATCH] distinct aggregates within a window function WIP

2020-01-13 Thread Vik Fearing
On 13/01/2020 15:19, Tom Lane wrote: > Krasiyan Andreev writes: >> I want to propose to you an old patch for Postgres 11, off-site developed >> by Oliver Ford, >> but I have permission from him to publish it and to continue it's >> development, >> that allow distinct aggregates, like select sum(di

Re: [PATCH] distinct aggregates within a window function WIP

2020-01-13 Thread Krasiyan Andreev
I understand yours note about datatype-specific operations, so I need to think more generic about it. About yours additional note, I think that it is not possible to get easy the same result with appropriate use of window framing options, because "exclude ties" will not exclude "current row" itself

Re: [PATCH] distinct aggregates within a window function WIP

2020-01-13 Thread Thomas Kellerer
Tom Lane schrieb am 13.01.2020 um 15:19: > what it is is attaching DISTINCT to a window function itself. > I'd still ask whether it's well-defined though, or even minimally > sensible. Window functions are generally supposed to produce one > row per input row --- how does that square with the imp

Re: [PATCH] distinct aggregates within a window function WIP

2020-01-13 Thread Tom Lane
Krasiyan Andreev writes: > I want to propose to you an old patch for Postgres 11, off-site developed > by Oliver Ford, > but I have permission from him to publish it and to continue it's > development, > that allow distinct aggregates, like select sum(distinct nums) within a > window function. I

[PATCH] distinct aggregates within a window function WIP

2020-01-13 Thread Krasiyan Andreev
Hi hackers, I want to propose to you an old patch for Postgres 11, off-site developed by Oliver Ford, but I have permission from him to publish it and to continue it's development, that allow distinct aggregates, like select sum(distinct nums) within a window function. I have rebased it for curre