Re: BUG #19638: Planner chooses an index-only scan for an index AM without amcanreturn, and execution fails

From: Manuel Reyes Bravo <manuelreyesbravo(at)gmail(dot)com>
To: Andrey Rachitskiy <pl0h0yp1(at)gmail(dot)com>
Cc: David Rowley <dgrowleyml(at)gmail(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19638: Planner chooses an index-only scan for an index AM without amcanreturn, and execution fails
Date: 2026-08-24 19:42:59
Message-ID: CA+bCEdCJJ2yWqqN+9+saQE3JFxjMr3LsMjbyoCrzJ5AWFbk8cQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

> Agreed, v3 fixed this.

Confirmed on 18.6. v3 applies with a 2-line offset and passes everything I
threw at the previous one:

the #19638 reproducer Seq Scan (disabled) -> 3, correct
count(*) over i_expr Index Only Scan (kept)
count(*) over i_col Index Only Scan (unchanged)
SELECT FROM t_nokey Seq Scan (disabled), correct
EXISTS (SELECT 1 FROM ...) Seq Scan (disabled), correct
make check all 231 tests passed

Tracking any_canreturn inside the existing loop is nicer than the separate
pass I suggested -- one traversal, and it reads as part of building the
bitmap rather than as an afterthought.

Nothing further from me on this one.

El lun, 24 ago 2026 a las 15:34, Andrey Rachitskiy (<pl0h0yp1(at)gmail(dot)com>)
escribió:

>
> пн, 24 авг. 2026 г. в 23:52, Manuel Reyes Bravo <
> manuelreyesbravo(at)gmail(dot)com>:
> unpatched: Aggregate -> Index Only Scan using i_expr on t_expr
> patched: Aggregate -> Seq Scan on t_expr (disabled)
>
> Agreed, v3 fixed this.
>
> --
> Regards,
> Rachitskiy Andrey
>

--
Saludos cordiales,

Manuel Reyes

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Zsolt Parragi 2026-08-24 22:06:33 Re: autovacuum: automatically propagate updated parameters
Previous Message Bharath Rupireddy 2026-08-24 19:42:00 Re: autovacuum: automatically propagate updated parameters