Re: Optimizer hook - Mailing list pgsql-patches

From Tom Lane
Subject Re: Optimizer hook
Date
Msg-id 8067.1190760570@sss.pgh.pa.us
Whole thread Raw
In response to Re: Optimizer hook  (Julius Stroffek <Julius.Stroffek@Sun.COM>)
Responses Re: Optimizer hook
List pgsql-patches
Julius Stroffek <Julius.Stroffek@Sun.COM> writes:
> Parts of the result path might be found by geqo and parts of it by
> regular algorithm.

Why would you care?  Seems like forcing that to not happen is actively
making it stupider.

> If there is no way of how to make the code work then it makes no sense
> to put the hook to the place I am proposing. It works for me, but I have
> not tested that very well yet. If I would swap calls to geqo
> and make_one_rel_by_joins it will not work. Therefore there might be
> an issue I do not know about yet.

Well, I can see one likely problem: list_copy is a shallow copy and
thus doesn't ensure that the second set of functions sees the same input
data structures as the first.  I know that geqo has to go through some
special pushups to perform multiple invocations of the base planner,
and I suspect you need that here too.  Look at geqo_eval().

            regards, tom lane

pgsql-patches by date:

Previous
From: Julius Stroffek
Date:
Subject: Re: Optimizer hook
Next
From: "Jaime Casanova"
Date:
Subject: Re: [HACKERS] 'Waiting on lock'