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-2025, 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 */
52extern 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
59extern PGDLLIMPORT int Geqo_pool_size; /* 2 .. inf, or 0 to use default */
60
61extern PGDLLIMPORT int Geqo_generations; /* 1 .. inf, or 0 to use default */
62
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
69extern PGDLLIMPORT double Geqo_seed; /* 0 .. 1 */
70
71
72/*
73 * Private state for a GEQO run --- accessible via root->join_search_private
74 */
75typedef 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 */
84 int number_of_rels, List *initial_rels);
85
86/* routines in geqo_eval.c */
87extern Cost geqo_eval(PlannerInfo *root, Gene *tour, int num_gene);
88extern RelOptInfo *gimme_tree(PlannerInfo *root, Gene *tour, int num_gene);
89
90#endif /* GEQO_H */
#define PGDLLIMPORT
Definition: c.h:1277
Cost geqo_eval(PlannerInfo *root, Gene *tour, int num_gene)
Definition: geqo_eval.c:57
PGDLLIMPORT int Geqo_pool_size
Definition: geqo_main.c:45
PGDLLIMPORT int Geqo_generations
Definition: geqo_main.c:46
RelOptInfo * geqo(PlannerInfo *root, int number_of_rels, List *initial_rels)
Definition: geqo_main.c:72
PGDLLIMPORT double Geqo_seed
Definition: geqo_main.c:48
RelOptInfo * gimme_tree(PlannerInfo *root, Gene *tour, int num_gene)
Definition: geqo_eval.c:163
PGDLLIMPORT double Geqo_selection_bias
Definition: geqo_main.c:47
PGDLLIMPORT int Geqo_effort
Definition: geqo_main.c:44
int Gene
Definition: geqo_gene.h:30
double Cost
Definition: nodes.h:251
tree ctl root
Definition: radixtree.h:1857
List * initial_rels
Definition: geqo.h:77
pg_prng_state random_state
Definition: geqo.h:78
Definition: pg_list.h:54