Re: Properly pathify the union planner
От | David Rowley |
---|---|
Тема | Re: Properly pathify the union planner |
Дата | |
Msg-id | CAApHDvoXPZ0K2HPwumz2B-ptfsbdyTb1esF3OO6-_JuKYWziAw@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Properly pathify the union planner (Andy Fan <zhihuifan1213@163.com>) |
Ответы |
Re: Properly pathify the union planner
|
Список | pgsql-hackers |
On Wed, 7 Feb 2024 at 12:05, Andy Fan <zhihuifan1213@163.com> wrote: > +static int > +pathkeys_useful_for_setop(PlannerInfo *root, List *pathkeys) > +{ > + int n_common_pathkeys; > + > + if (root->setop_pathkeys == NIL) > + return 0; /* no special setop ordering requested */ > + > + if (pathkeys == NIL) > + return 0; /* unordered path */ > + > + (void) pathkeys_count_contained_in(root->setop_pathkeys, pathkeys, > + &n_common_pathkeys); > + > + return n_common_pathkeys; > +} > > The two if-clauses looks unnecessary, it should be handled by > pathkeys_count_contained_in already. The same issue exists in > pathkeys_useful_for_ordering as well. Attached patch fix it in master. I agree. I'd rather not have those redundant checks in pathkeys_useful_for_setop(), and I do want those functions to be as similar as possible. So I think adjusting it in master is a good idea. I've pushed your patch. David
В списке pgsql-hackers по дате отправления: