PostgreSQL Source Code git master
Loading...
Searching...
No Matches
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-2026, 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/*
15 * contributed by:
16 * =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
17 * * Martin Utesch * Institute of Automatic Control *
18 * = = University of Mining and Technology =
19 * * utesch@aut.tu-freiberg.de * Freiberg, Germany *
20 * =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
21 */
22
23#ifndef GEQO_H
24#define GEQO_H
25
26#include "common/pg_prng.h"
27#include "nodes/pathnodes.h"
29#include "optimizer/geqo_gene.h"
30
31
32/* GEQO debug flag */
33/*
34 * #define GEQO_DEBUG
35 */
36
37/* choose one recombination mechanism here */
38/*
39 * #define ERX
40 * #define PMX
41 * #define CX
42 * #define PX
43 * #define OX1
44 * #define OX2
45 */
46#define ERX
47
48
49/*
50 * Configuration options
51 *
52 * If you change these, update backend/utils/misc/postgresql.conf.sample
53 */
54extern PGDLLIMPORT int Geqo_effort; /* 1 .. 10, knob for adjustment of
55 * defaults */
56
57#define DEFAULT_GEQO_EFFORT 5
58#define MIN_GEQO_EFFORT 1
59#define MAX_GEQO_EFFORT 10
60
61extern PGDLLIMPORT int Geqo_pool_size; /* 2 .. inf, or 0 to use default */
62
63extern PGDLLIMPORT int Geqo_generations; /* 1 .. inf, or 0 to use default */
64
66
68
69#define DEFAULT_GEQO_SELECTION_BIAS 2.0
70#define MIN_GEQO_SELECTION_BIAS 1.5
71#define MAX_GEQO_SELECTION_BIAS 2.0
72
73extern PGDLLIMPORT double Geqo_seed; /* 0 .. 1 */
74
75
76/*
77 * Private state for a GEQO run --- accessible via GetGeqoPrivateData
78 */
79typedef struct
80{
81 List *initial_rels; /* the base relations we are joining */
82 pg_prng_state random_state; /* PRNG state */
84
85static inline GeqoPrivateData *
87{
88 /* headers must be C++-compliant, so the cast is required here */
89 return (GeqoPrivateData *)
91}
92
93/* routines in geqo_main.c */
95 int number_of_rels, List *initial_rels);
96
97/* routines in geqo_eval.c */
100
101#endif /* GEQO_H */
#define PGDLLIMPORT
Definition c.h:1421
static void * GetPlannerInfoExtensionState(PlannerInfo *root, int extension_id)
Definition extendplan.h:39
static GeqoPrivateData * GetGeqoPrivateData(PlannerInfo *root)
Definition geqo.h:86
Cost geqo_eval(PlannerInfo *root, Gene *tour, int num_gene)
Definition geqo_eval.c:57
PGDLLIMPORT int Geqo_pool_size
Definition geqo_main.c:46
PGDLLIMPORT int Geqo_generations
Definition geqo_main.c:47
PGDLLIMPORT int Geqo_planner_extension_id
Definition geqo_main.c:52
RelOptInfo * geqo(PlannerInfo *root, int number_of_rels, List *initial_rels)
Definition geqo_main.c:75
PGDLLIMPORT double Geqo_seed
Definition geqo_main.c:49
RelOptInfo * gimme_tree(PlannerInfo *root, Gene *tour, int num_gene)
Definition geqo_eval.c:163
PGDLLIMPORT double Geqo_selection_bias
Definition geqo_main.c:48
PGDLLIMPORT int Geqo_effort
Definition geqo_main.c:45
int Gene
Definition geqo_gene.h:33
double Cost
Definition nodes.h:261
static int fb(int x)
tree ctl root
Definition radixtree.h:1857
List * initial_rels
Definition geqo.h:81
pg_prng_state random_state
Definition geqo.h:82
Definition pg_list.h:54