Re: add_path optimization

From: Grzegorz Jaskiewicz <gj(at)pointblue(dot)com(dot)pl>
To: Robert Haas <robertmhaas(at)gmail(dot)com>, David Fetter <david(at)fetter(dot)org>
Cc: pgsql-hackers Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: add_path optimization
Date: 2009-02-01 20:25:39
Message-ID: 7158A1B1-545A-42D1-AA9C-35DE00D90FAE@pointblue.com.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2009-02-01 21:35:30 Re: add_path optimization
Previous Message Joshua Tolley 2009-02-01 20:15:38 Re: adding stuff to parser, question