1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-28 11:55:03 +03:00
Files
postgres/src/include/optimizer/geqo.h
Tom Lane 9ab4d98168 Remove planner's private fields from Query struct, and put them into
a new PlannerInfo struct, which is passed around instead of the bare
Query in all the planning code.  This commit is essentially just a
code-beautification exercise, but it does open the door to making
larger changes to the planner data structures without having to muck
with the widely-known Query struct.
2005-06-05 22:32:58 +00:00

90 lines
2.2 KiB
C

/*-------------------------------------------------------------------------
*
* geqo.h
* prototypes for various files in optimizer/geqo
*
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/optimizer/geqo.h,v 1.39 2005/06/05 22:32:58 tgl Exp $
*
*-------------------------------------------------------------------------
*/
/* contributed by:
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
* Martin Utesch * Institute of Automatic Control *
= = University of Mining and Technology =
* utesch@aut.tu-freiberg.de * Freiberg, Germany *
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
*/
#ifndef GEQO_H
#define GEQO_H
#include "nodes/relation.h"
#include "optimizer/geqo_gene.h"
/* GEQO debug flag */
/*
#define GEQO_DEBUG
*/
/* recombination mechanism */
/*
#define ERX
#define PMX
#define CX
#define PX
#define OX1
#define OX2
*/
#define ERX
/*
* Configuration options
*
* If you change these, update backend/utils/misc/postgresql.sample.conf
*/
extern int Geqo_effort; /* 1 .. 10, knob for adjustment of
* defaults */
#define DEFAULT_GEQO_EFFORT 5
#define MIN_GEQO_EFFORT 1
#define MAX_GEQO_EFFORT 10
extern int Geqo_pool_size; /* 2 .. inf, or 0 to use default */
extern int Geqo_generations; /* 1 .. inf, or 0 to use default */
extern double Geqo_selection_bias;
#define DEFAULT_GEQO_SELECTION_BIAS 2.0
#define MIN_GEQO_SELECTION_BIAS 1.5
#define MAX_GEQO_SELECTION_BIAS 2.0
/*
* Data structure to encapsulate information needed for building plan trees
* (i.e., geqo_eval and gimme_tree).
*/
typedef struct
{
PlannerInfo *root; /* the query we are planning */
List *initial_rels; /* the base relations */
} GeqoEvalData;
/* routines in geqo_main.c */
extern RelOptInfo *geqo(PlannerInfo *root,
int number_of_rels, List *initial_rels);
/* routines in geqo_eval.c */
extern Cost geqo_eval(Gene *tour, int num_gene, GeqoEvalData *evaldata);
extern RelOptInfo *gimme_tree(Gene *tour, int num_gene,
GeqoEvalData *evaldata);
#endif /* GEQO_H */