git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: c43feef) | patch
Make GEQO's planning deterministic by having it start from a predictable
2009年7月16日 20:55:44 +0000 (20:55 +0000)
2009年7月16日 20:55:44 +0000 (20:55 +0000)
commit f5bc74192d2ffb32952a06c62b3458d28ff7f98f
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
27 files changed:
doc/src/sgml/config.sgml diff | blob | blame | history
doc/src/sgml/geqo.sgml diff | blob | blame | history
src/backend/optimizer/geqo/Makefile diff | blob | blame | history
src/backend/optimizer/geqo/geqo_copy.c diff | blob | blame | history
src/backend/optimizer/geqo/geqo_cx.c diff | blob | blame | history
src/backend/optimizer/geqo/geqo_erx.c diff | blob | blame | history
src/backend/optimizer/geqo/geqo_eval.c diff | blob | blame | history
src/backend/optimizer/geqo/geqo_main.c diff | blob | blame | history
src/backend/optimizer/geqo/geqo_mutation.c diff | blob | blame | history
src/backend/optimizer/geqo/geqo_ox1.c diff | blob | blame | history
src/backend/optimizer/geqo/geqo_ox2.c diff | blob | blame | history
src/backend/optimizer/geqo/geqo_pmx.c diff | blob | blame | history
src/backend/optimizer/geqo/geqo_pool.c diff | blob | blame | history
src/backend/optimizer/geqo/geqo_px.c diff | blob | blame | history
src/backend/optimizer/geqo/geqo_random.c [new file with mode: 0644] blob
src/backend/optimizer/geqo/geqo_recombination.c diff | blob | blame | history
src/backend/optimizer/geqo/geqo_selection.c diff | blob | blame | history
src/backend/utils/misc/guc.c diff | blob | blame | history
src/backend/utils/misc/postgresql.conf.sample diff | blob | blame | history
src/include/nodes/relation.h diff | blob | blame | history
src/include/optimizer/geqo.h diff | blob | blame | history
src/include/optimizer/geqo_copy.h diff | blob | blame | history
src/include/optimizer/geqo_mutation.h diff | blob | blame | history
src/include/optimizer/geqo_pool.h diff | blob | blame | history
src/include/optimizer/geqo_random.h diff | blob | blame | history
src/include/optimizer/geqo_recombination.h diff | blob | blame | history
src/include/optimizer/geqo_selection.h diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /