Startup subpaths in MergeAppend path

Started by Andrei Lepikhovover 1 year ago1 messageshackers

Thread notes

1 note#performance#minor#enhancement
hackorum-bot#performance#minor#enhancement
hackorum-bot
1 day ago

@global #performance #minor #enhancement

#performance#minor#enhancement
Jump to latest
#1Andrei Lepikhov
lepihov@gmail.com

Hi,

Upon reviewing [1]/messages/by-id/25d6a2cd161673d51373b7e07e6d9dd6@postgrespro.ru, 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]: /messages/by-id/25d6a2cd161673d51373b7e07e6d9dd6@postgrespro.ru
/messages/by-id/25d6a2cd161673d51373b7e07e6d9dd6@postgrespro.ru

--
regards, Andrei Lepikhov

Attachments:

t51487_1
0001-Consider-startup-paths-in-MergeAppend-only-if-fracti.patchtext/x-patch; charset=UTF-8; name=0001-Consider-startup-paths-in-MergeAppend-only-if-fracti.patchDownload+43-30