On Tue, Oct 14, 2025 at 3:03 PM David Rowley <[email protected]> wrote: > Here's a list of what I've changed: > > 1. Add count_common_leading_pathkeys_ordered() function to check for > leading common pathkeys and use that for sort_pathkeys, > window_pathkeys and window_pathkeys. > 2. Add count_common_leading_pathkeys_unordered() to check for leading > common pathkeys that exist in any portion of the other list of > pathkeys. Use this for group_pathkeys and distinct_pathkeys. > 3. Add some short-circuiting to truncate_useless_pathkeys() as there's > no point in trying to trim down the list when some other operation has > already figured out that it needs all of the pathkeys. > 4. Remove the stray " if (root->group_pathkeys != NIL) return true" > from has_useful_pathkeys().
+1. I think this is a nice tidy-up. FWIW, I complained about the stray check in has_useful_pathkeys() in [1] last week, but you were quicker than me in making the code change to remove it. [1] https://postgr.es/m/CAMbWs4_zW5QU=zk32s17p8qwy+ga-3zutons+y+wopguiop...@mail.gmail.com - Richard
