Hi Richard, On Tue, Jan 10, 2023 at 8:06 PM Richard Guo <guofengli...@gmail.com> wrote: > In add_paths_with_pathkeys_for_rel, we do not try incremental sort atop > of the epq_path, which I think we can do. I'm not sure how useful this > is in real world since the epq_path is used only for EPQ checks, but it > seems doing that doesn't cost too much.
I'm not sure this is a good idea, because the epq_path will return at most one tuple in an EPQ recheck. The reason why an extra Sort node is injected into the epq_path is only label it with the correct sort order to use it as an input for the EPQ merge-join path of a higher-level foreign join, so shouldn't we keep this step as much as simple and save cycles even a little? Sorry for being late to the party. Best regards, Etsuro Fujita