PostgreSQL Source Code  git master
geqo.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * geqo.h
4  * prototypes for various files in optimizer/geqo
5  *
6  * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
7  * Portions Copyright (c) 1994, Regents of the University of California
8  *
9  * src/include/optimizer/geqo.h
10  *
11  *-------------------------------------------------------------------------
12  */
13 
14 /* contributed by:
15  =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
16  * Martin Utesch * Institute of Automatic Control *
17  = = University of Mining and Technology =
18  * utesch@aut.tu-freiberg.de * Freiberg, Germany *
19  =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
20  */
21 
22 #ifndef GEQO_H
23 #define GEQO_H
24 
25 #include "common/pg_prng.h"
26 #include "nodes/pathnodes.h"
27 #include "optimizer/geqo_gene.h"
28 
29 
30 /* GEQO debug flag */
31 /*
32  #define GEQO_DEBUG
33  */
34 
35 /* choose one recombination mechanism here */
36 /*
37  #define ERX
38  #define PMX
39  #define CX
40  #define PX
41  #define OX1
42  #define OX2
43  */
44 #define ERX
45 
46 
47 /*
48  * Configuration options
49  *
50  * If you change these, update backend/utils/misc/postgresql.conf.sample
51  */
52 extern PGDLLIMPORT int Geqo_effort; /* 1 .. 10, knob for adjustment of
53  * defaults */
54 
55 #define DEFAULT_GEQO_EFFORT 5
56 #define MIN_GEQO_EFFORT 1
57 #define MAX_GEQO_EFFORT 10
58 
59 extern PGDLLIMPORT int Geqo_pool_size; /* 2 .. inf, or 0 to use default */
60 
61 extern PGDLLIMPORT int Geqo_generations; /* 1 .. inf, or 0 to use default */
62 
63 extern PGDLLIMPORT double Geqo_selection_bias;
64 
65 #define DEFAULT_GEQO_SELECTION_BIAS 2.0
66 #define MIN_GEQO_SELECTION_BIAS 1.5
67 #define MAX_GEQO_SELECTION_BIAS 2.0
68 
69 extern PGDLLIMPORT double Geqo_seed; /* 0 .. 1 */
70 
71 
72 /*
73  * Private state for a GEQO run --- accessible via root->join_search_private
74  */
75 typedef struct
76 {
77  List *initial_rels; /* the base relations we are joining */
78  pg_prng_state random_state; /* PRNG state */
80 
81 
82 /* routines in geqo_main.c */
83 extern RelOptInfo *geqo(PlannerInfo *root,
84  int number_of_rels, List *initial_rels);
85 
86 /* routines in geqo_eval.c */
87 extern Cost geqo_eval(PlannerInfo *root, Gene *tour, int num_gene);
88 extern RelOptInfo *gimme_tree(PlannerInfo *root, Gene *tour, int num_gene);
89 
90 #endif /* GEQO_H */
#define PGDLLIMPORT
Definition: c.h:1252
Cost geqo_eval(PlannerInfo *root, Gene *tour, int num_gene)
Definition: geqo_eval.c:57
PGDLLIMPORT int Geqo_pool_size
Definition: geqo_main.c:40
RelOptInfo * gimme_tree(PlannerInfo *root, Gene *tour, int num_gene)
Definition: geqo_eval.c:163
PGDLLIMPORT int Geqo_generations
Definition: geqo_main.c:41
RelOptInfo * geqo(PlannerInfo *root, int number_of_rels, List *initial_rels)
Definition: geqo_main.c:67
PGDLLIMPORT double Geqo_seed
Definition: geqo_main.c:43
PGDLLIMPORT double Geqo_selection_bias
Definition: geqo_main.c:42
PGDLLIMPORT int Geqo_effort
Definition: geqo_main.c:39
int Gene
Definition: geqo_gene.h:30
double Cost
Definition: nodes.h:251
List * initial_rels
Definition: geqo.h:77
pg_prng_state random_state
Definition: geqo.h:78
Definition: pg_list.h:52