Re: Row pattern recognition

From: Henson Choi <assam258(at)gmail(dot)com>
To: jian he <jian(dot)universality(at)gmail(dot)com>, Tatsuo Ishii <ishii(at)postgresql(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org, zsolt(dot)parragi(at)percona(dot)com, sjjang112233(at)gmail(dot)com, vik(at)postgresfriends(dot)org, er(at)xs4all(dot)nl, jacob(dot)champion(at)enterprisedb(dot)com, david(dot)g(dot)johnston(at)gmail(dot)com, peter(at)eisentraut(dot)org, li(dot)evan(dot)chao(at)gmail(dot)com
Subject: Re: Row pattern recognition
Date: 2026-06-26 01:23:53
Message-ID: CAAAe_zBAwUbzahW3wFM+toS6Ap565j1q9SOa0irhYSRTujGbyA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,

A quick heads-up for this thread, cross-referenced from another one.

Haibo Yan has a patch series adding DISTINCT support to plain aggregate
window functions [1]. As it touches window-aggregate frame handling, I
applied it on top of the current RPR patch set and built the two together.
They combine cleanly today: no rebase conflict, and the regression tests
pass with no change to code or tests.

This is structural, not luck. RPR requires the frame to start at CURRENT
ROW, while that feature requires UNBOUNDED PRECEDING, so a single window can
satisfy at most one of them -- no overlap.

That said, the DISTINCT roadmap plans to relax its UNBOUNDED-PRECEDING
restriction (the sliding-frame patches), while RPR's CURRENT-ROW requirement
is fixed by the standard. So as those frame restrictions are lifted the two
could start to overlap, and at that point we'd likely need to review the
related frame-handling changes together. Nothing to act on now -- just
flagging it so we keep an eye on it.

Full review of the DISTINCT series is in the other thread [1].

[1]
https://www.postgresql.org/message-id/CAAAe_zCfVbNrOUF5FaE38EcwYbtXacThR9xdVe2UJJPeDSL2KA@mail.gmail.com

Best,
Henson

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Henson Choi 2026-06-26 01:37:23 Re: Row pattern recognition
Previous Message Henson Choi 2026-06-26 01:03:43 Re: [PATCH] DISTINCT in plain aggregate window functions