On Wed, 18 Nov 2026 at 21:38, PG Bug reporting form
<noreply(at)postgresql(dot)org> wrote:
> But in the single query, the qual is pushed below the Unique node (EXPLAIN
> shows the filter on the scan), the grouping only sees row (2, 1.0), and the
> query returns a row the subquery never produces:
>
> ```sql
> EXPLAIN (COSTS OFF)
> SELECT * FROM (SELECT DISTINCT ON (a) id, a FROM m ORDER BY a, id) s
> WHERE scale(s.a) = 1;
> ```
This is effectively a duplicate of bugs #19619, #19697, and #19713.
Can you reply here with the answer to the question in [1]? We'd very
much like to know why you think this is important.
David
[1] https://postgr.es/m/1187008.1790094524@sss.pgh.pa.us