Header And Logo

PostgreSQL
| The world's most advanced open source database.

geqo.h

Go to the documentation of this file.
00001 /*-------------------------------------------------------------------------
00002  *
00003  * geqo.h
00004  *    prototypes for various files in optimizer/geqo
00005  *
00006  * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group
00007  * Portions Copyright (c) 1994, Regents of the University of California
00008  *
00009  * src/include/optimizer/geqo.h
00010  *
00011  *-------------------------------------------------------------------------
00012  */
00013 
00014 /* contributed by:
00015    =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
00016    *  Martin Utesch              * Institute of Automatic Control      *
00017    =                             = University of Mining and Technology =
00018    *  [email protected]  * Freiberg, Germany                   *
00019    =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
00020  */
00021 
00022 #ifndef GEQO_H
00023 #define GEQO_H
00024 
00025 #include "nodes/relation.h"
00026 #include "optimizer/geqo_gene.h"
00027 
00028 
00029 /* GEQO debug flag */
00030 /*
00031  #define GEQO_DEBUG
00032  */
00033 
00034 /* recombination mechanism */
00035 /*
00036  #define ERX
00037  #define PMX
00038  #define CX
00039  #define PX
00040  #define OX1
00041  #define OX2
00042  */
00043 #define ERX
00044 
00045 
00046 /*
00047  * Configuration options
00048  *
00049  * If you change these, update backend/utils/misc/postgresql.conf.sample
00050  */
00051 extern int  Geqo_effort;        /* 1 .. 10, knob for adjustment of defaults */
00052 
00053 #define DEFAULT_GEQO_EFFORT 5
00054 #define MIN_GEQO_EFFORT 1
00055 #define MAX_GEQO_EFFORT 10
00056 
00057 extern int  Geqo_pool_size;     /* 2 .. inf, or 0 to use default */
00058 
00059 extern int  Geqo_generations;   /* 1 .. inf, or 0 to use default */
00060 
00061 extern double Geqo_selection_bias;
00062 
00063 #define DEFAULT_GEQO_SELECTION_BIAS 2.0
00064 #define MIN_GEQO_SELECTION_BIAS 1.5
00065 #define MAX_GEQO_SELECTION_BIAS 2.0
00066 
00067 extern double Geqo_seed;        /* 0 .. 1 */
00068 
00069 
00070 /*
00071  * Private state for a GEQO run --- accessible via root->join_search_private
00072  */
00073 typedef struct
00074 {
00075     List       *initial_rels;   /* the base relations we are joining */
00076     unsigned short random_state[3];     /* state for pg_erand48() */
00077 } GeqoPrivateData;
00078 
00079 
00080 /* routines in geqo_main.c */
00081 extern RelOptInfo *geqo(PlannerInfo *root,
00082      int number_of_rels, List *initial_rels);
00083 
00084 /* routines in geqo_eval.c */
00085 extern Cost geqo_eval(PlannerInfo *root, Gene *tour, int num_gene);
00086 extern RelOptInfo *gimme_tree(PlannerInfo *root, Gene *tour, int num_gene);
00087 
00088 #endif   /* GEQO_H */