pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: tgl@postgresql.org
To: pgsql-committers@postgresql.org
Subject: pgsql: Make GEQO's planning deterministic by having it start from a
Date: Thu, 16 Jul 2009 20:55:45 +0000 (UTC)
Message-ID: <20090716205545.0B7F075331E@cvs.postgresql.org> (raw)

Log Message:
-----------
Make GEQO's planning deterministic by having it start from a predictable
random number seed each time.  This is how it used to work years ago, but
we got rid of the seed reset because it was resetting the main random()
sequence and thus having undesirable effects on the rest of the system.
To fix, establish a private random number state for each execution of
geqo(), and initialize the state using the new GUC variable geqo_seed.
People who want to experiment with different random searches can do so
by changing geqo_seed, but you'll always get the same plan for the same
value of geqo_seed (if holding all other planner inputs constant, of course).

The new state is kept in PlannerInfo by adding a "void *" field reserved
for use by join_search hooks.  Most of the rather bulky code changes in
this commit are just arranging to pass PlannerInfo around to all the GEQO
functions (many of which formerly didn't receive it).

Andres Freund, with some editorialization by Tom

Modified Files:
--------------
    pgsql/doc/src/sgml:
        config.sgml (r1.221 -> r1.222)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/config.sgml?r1=1.221&r2=1.222)
        geqo.sgml (r1.40 -> r1.41)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/geqo.sgml?r1=1.40&r2=1.41)
    pgsql/src/backend/optimizer/geqo:
        Makefile (r1.20 -> r1.21)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/geqo/Makefile?r1=1.20&r2=1....)
        geqo_copy.c (r1.19 -> r1.20)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/geqo/geqo_copy.c?r1=1.19&r2...)
        geqo_cx.c (r1.10 -> r1.11)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/geqo/geqo_cx.c?r1=1.10&r2=1...)
        geqo_erx.c (r1.20 -> r1.21)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/geqo/geqo_erx.c?r1=1.20&r2=...)
        geqo_eval.c (r1.88 -> r1.89)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/geqo/geqo_eval.c?r1=1.88&r2...)
        geqo_main.c (r1.56 -> r1.57)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/geqo/geqo_main.c?r1=1.56&r2...)
        geqo_mutation.c (r1.9 -> r1.10)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/geqo/geqo_mutation.c?r1=1.9&...)
        geqo_ox1.c (r1.9 -> r1.10)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/geqo/geqo_ox1.c?r1=1.9&r2=1...)
        geqo_ox2.c (r1.10 -> r1.11)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/geqo/geqo_ox2.c?r1=1.10&r2=...)
        geqo_pmx.c (r1.10 -> r1.11)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/geqo/geqo_pmx.c?r1=1.10&r2=...)
        geqo_pool.c (r1.33 -> r1.34)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/geqo/geqo_pool.c?r1=1.33&r2...)
        geqo_px.c (r1.10 -> r1.11)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/geqo/geqo_px.c?r1=1.10&r2=1...)
        geqo_recombination.c (r1.15 -> r1.16)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/geqo/geqo_recombination.c?r1=1....)
        geqo_selection.c (r1.24 -> r1.25)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/geqo/geqo_selection.c?r1=1.24&a...)
    pgsql/src/backend/utils/misc:
        guc.c (r1.507 -> r1.508)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/misc/guc.c?r1=1.507&r2=1.508)
        postgresql.conf.sample (r1.261 -> r1.262)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/misc/postgresql.conf.sample?r1=1.26...)
    pgsql/src/include/nodes:
        relation.h (r1.173 -> r1.174)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/nodes/relation.h?r1=1.173&r2=1.174)
    pgsql/src/include/optimizer:
        geqo.h (r1.44 -> r1.45)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/optimizer/geqo.h?r1=1.44&r2=1.45)
        geqo_copy.h (r1.21 -> r1.22)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/optimizer/geqo_copy.h?r1=1.21&r2=1.22)
        geqo_mutation.h (r1.21 -> r1.22)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/optimizer/geqo_mutation.h?r1=1.21&r2=...)
        geqo_pool.h (r1.25 -> r1.26)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/optimizer/geqo_pool.h?r1=1.25&r2=1.26)
        geqo_random.h (r1.21 -> r1.22)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/optimizer/geqo_random.h?r1=1.21&r2=1....)
        geqo_recombination.h (r1.20 -> r1.21)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/optimizer/geqo_recombination.h?r1=1.20&am...)
        geqo_selection.h (r1.21 -> r1.22)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/optimizer/geqo_selection.h?r1=1.21&r2...)

Added Files:
-----------
    pgsql/src/backend/optimizer/geqo:
        geqo_random.c (r1.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/geqo/geqo_random.c?rev=1.1&...)




view thread (2+ messages)  latest in thread

Message-ID: <20090716205545.0B7F075331E@cvs.postgresql.org>
Permalink:  ../20090716205545.0B7F075331E@cvs.postgresql.org/
Also on:    postgresql.org/message-id/20090716205545.0B7F075331E@cvs.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tgl@postgresql.org
  Subject: Re: pgsql: Make GEQO's planning deterministic by having it start from a
  In-Reply-To: <20090716205545.0B7F075331E@cvs.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox