Re: BUG #19638: Planner chooses an index-only scan for an index AM without amcanreturn, and execution fails
От
Manuel Reyes Bravo
Тема
Re: BUG #19638: Planner chooses an index-only scan for an index AM without amcanreturn, and execution fails
Дата
Msg-id
CA+bCEdCJJ2yWqqN+9+saQE3JFxjMr3LsMjbyoCrzJ5AWFbk8cQ@mail.gmail.com
Список
Дерево обсуждения
Re: ON EMPTY clause for aggregate and window functions Tom Lane <tgl@sss.pgh.pa.us>
Re: ON EMPTY clause for aggregate and window functions Vik Fearing <vik@postgresfriends.org>
Re: ON EMPTY clause for aggregate and window functions Tom Lane <tgl@sss.pgh.pa.us>
> 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.
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@gmail.com>) escribió:
--пн, 24 авг. 2026 г. в 23:52, Manuel Reyes Bravo <manuelreyesbravo@gmail.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В списке pgsql-bugs по дате отправления
От: Bharath Rupireddy
Дата:
От: Nathan Bossart
Дата: