mirror of
https://github.com/postgres/postgres.git
synced 2025-11-28 11:44:57 +03:00
Revise GEQO planner to make use of some heuristic knowledge about SQL, namely
that it's good to join where there are join clauses rather than where there are not. Also enable it to generate bushy plans at need, so that it doesn't fail in the presence of multiple IN clauses containing sub-joins. These changes appear to improve the behavior enough that we can substantially reduce the default pool size and generations count, thereby decreasing the runtime, and yet get as good or better plans as we were getting in 7.4. Consequently, adjust the default GEQO parameters. I also modified the way geqo_effort is used so that it affects both population size and number of generations; it's now useful as a single control to adjust the GEQO runtime-vs-plan-quality tradeoff. Bump geqo_threshold to 12, since even with these changes GEQO seems to be slower than the regular planner at 11 relations.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/optimizer/geqo_pool.h,v 1.18 2003/11/29 22:41:07 pgsql Exp $
|
||||
* $PostgreSQL: pgsql/src/include/optimizer/geqo_pool.h,v 1.19 2004/01/23 23:54:21 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -23,14 +23,13 @@
|
||||
#ifndef GEQO_POOL_H
|
||||
#define GEQO_POOL_H
|
||||
|
||||
#include "optimizer/geqo_gene.h"
|
||||
#include "nodes/parsenodes.h"
|
||||
#include "optimizer/geqo.h"
|
||||
|
||||
|
||||
extern Pool *alloc_pool(int pool_size, int string_length);
|
||||
extern void free_pool(Pool *pool);
|
||||
|
||||
extern void random_init_pool(Query *root, List *initial_rels,
|
||||
Pool *pool, int strt, int stop);
|
||||
extern void random_init_pool(Pool *pool, GeqoEvalData *evaldata);
|
||||
extern Chromosome *alloc_chromo(int string_length);
|
||||
extern void free_chromo(Chromosome *chromo);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user