Re: add_path optimization
От | Grzegorz Jaskiewicz |
---|---|
Тема | Re: add_path optimization |
Дата | |
Msg-id | 7158A1B1-545A-42D1-AA9C-35DE00D90FAE@pointblue.com.pl обсуждение исходный текст |
Ответ на | Re: add_path optimization (Robert Haas <robertmhaas@gmail.com>) |
Ответы |
Re: add_path optimization
|
Список | pgsql-hackers |
disclaimer: I don't know that bit of postgresql code, in fact - this is the first time I see it. *** a/src/backend/optimizer/path/joinpath.c --- b/src/backend/optimizer/path/joinpath.c *************** *** 473,478 **** match_unsorted_outer(PlannerInfo *root, --- 473,481 ---- if (nestjoinOK) { + Path *paths[5]; I don't like the fact that you hardcoded that here. I know that you are trying to pass on few calls in one go here, but still... ugly. static int compare_fuzzy_path_costs(Path *path1, Path *path2, int *startup_cost) { ....*startup_cost = (s == 0) ? t : s; Why not *startup_cost = s, and let the caller decide which value it wants to use ? or just return both, from single call (which would ? ... return t; } To be fair, I don't see compare_fuzzy_path_costs change to save too much of time in planner. I would myself probably convert that function into two defines/inline funcs, but that's just me.
В списке pgsql-hackers по дате отправления: