Re: Solving sudoku using SQL - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Solving sudoku using SQL
Date
Msg-id 17547.1291830345@sss.pgh.pa.us
Whole thread Raw
In response to Re: Solving sudoku using SQL  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Solving sudoku using SQL  (Jan Urbański <wulczer@wulczer.org>)
List pgsql-hackers
I wrote:
> There is something funny going on there; it's not just that the planner
> is slower with a large flat search space.  It is slower, but only maybe
> 5x or so.  What I'm seeing is that it actually finds a much worse plan
> (very much larger estimated cost as well as actual runtime) when given
> the flat problem.  That seems like a bug: a constrained search ought
> never find a better solution than an unconstrained search.

Oh, wait: the problem of course is that it's switching into GEQO mode
and hence *not* doing a complete search.  Doh.  If you turn GEQO off
then planning takes ~ forever with the flat version of the query.

We could "fix" that by forcibly breaking up the search problem in the
same fashion that join_collapse_limit does, but I'm sure we'd get
complaints about that approach.

The real fix in my mind is to replace GEQO search with something
smarter.  I wonder what happened to the SA patch that was reported
on at PGCon.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Solving sudoku using SQL
Next
From: Jan Urbański
Date:
Subject: Re: Solving sudoku using SQL