Re: patch for geqo tweaks - Mailing list pgsql-hackers

From Tom Lane
Subject Re: patch for geqo tweaks
Date
Msg-id 2837.1446837401@sss.pgh.pa.us
Whole thread Raw
In response to Re: patch for geqo tweaks  (Nathan Wagner <nw+pg@hydaspes.if.org>)
Responses Re: patch for geqo tweaks  (Nathan Wagner <nw+pg@hydaspes.if.org>)
List pgsql-hackers
Nathan Wagner <nw+pg@hydaspes.if.org> writes:
> On Fri, Nov 06, 2015 at 11:45:38AM -0500, Tom Lane wrote:
>> (There's a fair amount of dead code in /geqo/, which I've never had
>> the energy to clean up, but maybe we should do that sometime.  It
>> seems unlikely that anyone will ever be interested in experimenting
>> with the ifdef'ed-out code paths.)

> I also note that in  src/backend/optimizer/path/allpaths.c there is a
> join_search_hook variable apparently intended for plugins (extensions?)
> to be able to control the search path optimizer.  And the geqo code is
> AFAICT turned off by default anyway, so none of the code is used in
> probably the vast majority of systems, with standard_join_search() being
> called instead.

Uh, what?  It's not by any means turned off by default.

postgres=# select name,setting from pg_settings where name like '%geqo%';       name         | setting 
---------------------+---------geqo                | ongeqo_effort         | 5geqo_generations    | 0geqo_pool_size
| 0geqo_seed           | 0geqo_selection_bias | 2geqo_threshold      | 12
 
(7 rows)

You do need at least 12 tables in the FROM list to get it to be exercised
with the default settings, which among other things means that our
regression tests don't stress it much at all.  But it's definitely
reachable.

> Would it be worth either of removing at least the non-ERX portions of
> the geqo code, or removing the geqo code entirely (presumably with a
> deprecation cycle) and moving it to an extension?

Removing it is right out, as you'll soon find if you try to plan a query
with a couple dozen tables with geqo turned off.  The standard exhaustive
search just gets too slow.

I'm inclined to think that removing all the ifdefd-out-by-default logic
would be a fine thing to do, though.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Kevin Grittner
Date:
Subject: Re: Getting sorted data from foreign server for merge join
Next
From: Peter Geoghegan
Date:
Subject: Re: SortSupport for UUID type