Hi David, Impressive results!
On Fri, Apr 4, 2025 at 3:05 PM David Rowley <dgrowle...@gmail.com> wrote: > I've done some further work on this, mostly relating to the code > comments. It looks to me like the following hunks in 0002 probably belong in 0001, unless you’re planning to commit the patches together anyway: diff --git a/src/backend/optimizer/path/indxpath.c b/src/backend/optimizer/path/indxpath.c index 6386ce82253..5c6410e0631 100644 --- a/src/backend/optimizer/path/indxpath.c +++ b/src/backend/optimizer/path/indxpath.c @@ -190,7 +190,7 @@ static IndexClause *expand_indexqual_rowcompare(PlannerInfo *root, IndexOptInfo *index, Oid expr_op, bool var_on_left); -static void match_pathkeys_to_index(IndexOptInfo *index, List *pathkeys, +static void match_pathkeys_to_index(PlannerInfo *root, IndexOptInfo *index, List *pathkeys, List **orderby_clauses_p, List **clause_columns_p); static Expr *match_clause_to_ordering_op(IndexOptInfo *index, @@ -934,7 +934,7 @@ build_index_paths(PlannerInfo *root, RelOptInfo *rel, * query_pathkeys will allow an incremental sort to be considered on * the index's partially sorted results. */ - match_pathkeys_to_index(index, root->query_pathkeys, + match_pathkeys_to_index(root, index, root->query_pathkeys, &orderbyclauses, &orderbyclausecols); if (list_length(root->query_pathkeys) == list_length(orderbyclauses)) The comment on EquivalenceMember might benefit from a mention of how ec_childmembers now fits into the picture -- do you think it’s worth updating? /* * EquivalenceMember - one member expression of an EquivalenceClass * * em_is_child signifies that this element was built by transposing a member * for an appendrel parent relation to represent the corresponding expression * for an appendrel child. ... + /* XXX ec_childmembers? */ Maybe we don’t need to print these, since the comment on em_is_child suggests they aren’t really full-fledged EC members and are meant to be ignored by most operations? -- Thanks, Amit Langote