PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
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-2017, 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 "nodes/relation.h"
26 #include "optimizer/geqo_gene.h"
27 
28 
29 /* GEQO debug flag */
30 /*
31  #define GEQO_DEBUG
32  */
33 
34 /* recombination mechanism */
35 /*
36  #define ERX
37  #define PMX
38  #define CX
39  #define PX
40  #define OX1
41  #define OX2
42  */
43 #define ERX
44 
45 
46 /*
47  * Configuration options
48  *
49  * If you change these, update backend/utils/misc/postgresql.conf.sample
50  */
51 extern int Geqo_effort; /* 1 .. 10, knob for adjustment of defaults */
52 
53 #define DEFAULT_GEQO_EFFORT 5
54 #define MIN_GEQO_EFFORT 1
55 #define MAX_GEQO_EFFORT 10
56 
57 extern int Geqo_pool_size; /* 2 .. inf, or 0 to use default */
58 
59 extern int Geqo_generations; /* 1 .. inf, or 0 to use default */
60 
61 extern double Geqo_selection_bias;
62 
63 #define DEFAULT_GEQO_SELECTION_BIAS 2.0
64 #define MIN_GEQO_SELECTION_BIAS 1.5
65 #define MAX_GEQO_SELECTION_BIAS 2.0
66 
67 extern double Geqo_seed; /* 0 .. 1 */
68 
69 
70 /*
71  * Private state for a GEQO run --- accessible via root->join_search_private
72  */
73 typedef struct
74 {
75  List *initial_rels; /* the base relations we are joining */
76  unsigned short random_state[3]; /* state for pg_erand48() */
78 
79 
80 /* routines in geqo_main.c */
81 extern RelOptInfo *geqo(PlannerInfo *root,
82  int number_of_rels, List *initial_rels);
83 
84 /* routines in geqo_eval.c */
85 extern Cost geqo_eval(PlannerInfo *root, Gene *tour, int num_gene);
86 extern RelOptInfo *gimme_tree(PlannerInfo *root, Gene *tour, int num_gene);
87 
88 #endif /* GEQO_H */
RelOptInfo * gimme_tree(PlannerInfo *root, Gene *tour, int num_gene)
Definition: geqo_eval.c:163
int Gene
Definition: geqo_gene.h:30
int Geqo_generations
Definition: geqo_main.c:41
Cost geqo_eval(PlannerInfo *root, Gene *tour, int num_gene)
Definition: geqo_eval.c:57
double Geqo_selection_bias
Definition: geqo_main.c:42
int Geqo_effort
Definition: geqo_main.c:39
RelOptInfo * geqo(PlannerInfo *root, int number_of_rels, List *initial_rels)
Definition: geqo_main.c:67
double Geqo_seed
Definition: geqo_main.c:43
List * initial_rels
Definition: geqo.h:75
Definition: pg_list.h:45
double Cost
Definition: nodes.h:639
int Geqo_pool_size
Definition: geqo_main.c:40