]> granicus.if.org Git - postgresql/blob - src/include/optimizer/geqo.h
Update CVS HEAD for 2007 copyright. Back branches are typically not
[postgresql] / src / include / optimizer / geqo.h
1 /*-------------------------------------------------------------------------
2  *
3  * geqo.h
4  *        prototypes for various files in optimizer/geqo
5  *
6  * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
7  * Portions Copyright (c) 1994, Regents of the University of California
8  *
9  * $PostgreSQL: pgsql/src/include/optimizer/geqo.h,v 1.42 2007/01/05 22:19:56 momjian Exp $
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.sample.conf
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
68 /*
69  * Data structure to encapsulate information needed for building plan trees
70  * (i.e., geqo_eval and gimme_tree).
71  */
72 typedef struct
73 {
74         PlannerInfo *root;                      /* the query we are planning */
75         List       *initial_rels;       /* the base relations */
76 } GeqoEvalData;
77
78
79 /* routines in geqo_main.c */
80 extern RelOptInfo *geqo(PlannerInfo *root,
81          int number_of_rels, List *initial_rels);
82
83 /* routines in geqo_eval.c */
84 extern Cost geqo_eval(Gene *tour, int num_gene, GeqoEvalData *evaldata);
85 extern RelOptInfo *gimme_tree(Gene *tour, int num_gene,
86                    GeqoEvalData *evaldata);
87
88 #endif   /* GEQO_H */