Hi,
Upon reviewing [1], I noticed an inconsistency: within the
add_paths_to_append_rel function, Postgres only constructs
startup_subpaths when the rel->consider_startup flag is set to true.
However, the generate_ordered_append_paths function generates these
paths regardless of this flag.
After examining the code, I found no scenario where a startup-optimal
path would be necessary if consider_startup is false. Impact on the
planning time might be noticeable in partitioned cases. Therefore, does
it make sense to include startup paths only when it is necessary?
I created a simple patch to address this issue, and it has successfully
passed all regression tests. If I overlooked something, it would be
beneficial to add a regression test demonstrating the necessity of
startup paths regardless of declared limits.
Anyway, it will be beneficial to discuss this logic in the mailing list.
[1]
https://www.postgresql.org/message-id/flat/25d6a2cd161673d51373b7e07e6d9dd6%40postgrespro.ru
--
regards, Andrei Lepikhov