Re: [PATCH] distinct aggregates within a window function WIP
| От | Thomas Kellerer |
|---|---|
| Тема | Re: [PATCH] distinct aggregates within a window function WIP |
| Дата | |
| Msg-id | 17d78132-6594-3bce-8f17-7184b916341f@gmx.net обсуждение исходный текст |
| Ответ на | Re: [PATCH] distinct aggregates within a window function WIP (Tom Lane <tgl@sss.pgh.pa.us>) |
| Список | pgsql-hackers |
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 implicit row > merging of DISTINCT? They're also typically row-order-sensitive > --- how does that work with DISTINCT? Also, to the extent that > this is sensible, can't you get the same results already today > with appropriate use of window framing options? I find the example using array_agg() and cumulative window functions a bit confusing as well, but I think there are situations where having this is really helpful, e.g.: count(distinct some_column) over (partition by something) I know it's not an argument, but Oracle supports this and porting queries like that from Oracle to Postgres isn't really fun. Thomas
В списке pgsql-hackers по дате отправления: