Re: add_path optimization - Mailing list pgsql-hackers

From Grzegorz Jaskiewicz
Subject Re: add_path optimization
Date
Msg-id 7158A1B1-545A-42D1-AA9C-35DE00D90FAE@pointblue.com.pl
Whole thread Raw
In response to Re: add_path optimization  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: add_path optimization
List 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 by date:

Previous
From: Joshua Tolley
Date:
Subject: Re: adding stuff to parser, question
Next
From: Robert Haas
Date:
Subject: Re: add_path optimization