PostgreSQL Source Code: src/include/optimizer/geqo.h Source File

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/extendplan.h"
28#include "optimizer/geqo_gene.h"
29
30
31/* GEQO debug flag */
32/*
33 #define GEQO_DEBUG
34 */
35
36/* choose one recombination mechanism here */
37/*
38 #define ERX
39 #define PMX
40 #define CX
41 #define PX
42 #define OX1
43 #define OX2
44 */
45 #define ERX
46
47
48/*
49 * Configuration options
50 *
51 * If you change these, update backend/utils/misc/postgresql.conf.sample
52 */
53extern PGDLLIMPORT int Geqo_effort; /* 1 .. 10, knob for adjustment of
54 * defaults */
55
56 #define DEFAULT_GEQO_EFFORT 5
57 #define MIN_GEQO_EFFORT 1
58 #define MAX_GEQO_EFFORT 10
59
60extern PGDLLIMPORT int Geqo_pool_size; /* 2 .. inf, or 0 to use default */
61
62extern PGDLLIMPORT int Geqo_generations; /* 1 .. inf, or 0 to use default */
63
64extern PGDLLIMPORT double Geqo_selection_bias;
65
66extern PGDLLIMPORT int Geqo_planner_extension_id;
67
68 #define DEFAULT_GEQO_SELECTION_BIAS 2.0
69 #define MIN_GEQO_SELECTION_BIAS 1.5
70 #define MAX_GEQO_SELECTION_BIAS 2.0
71
72extern PGDLLIMPORT double Geqo_seed; /* 0 .. 1 */
73
74
75/*
76 * Private state for a GEQO run --- accessible via GetGeqoPrivateData
77 */
78 typedef struct
79{
80 List *initial_rels; /* the base relations we are joining */
81 pg_prng_state random_state; /* PRNG state */
82} GeqoPrivateData;
83
84static inline GeqoPrivateData *
85 GetGeqoPrivateData(PlannerInfo *root)
86{
87 /* headers must be C++-compliant, so the cast is required here */
88 return (GeqoPrivateData *)
89 GetPlannerInfoExtensionState(root, Geqo_planner_extension_id);
90}
91
92/* routines in geqo_main.c */
93extern RelOptInfo *geqo(PlannerInfo *root,
94 int number_of_rels, List *initial_rels);
95
96/* routines in geqo_eval.c */
97extern Cost geqo_eval(PlannerInfo *root, Gene *tour, int num_gene);
98extern RelOptInfo *gimme_tree(PlannerInfo *root, Gene *tour, int num_gene);
99
100#endif /* GEQO_H */
#define PGDLLIMPORT
Definition: c.h:1319
static void * GetPlannerInfoExtensionState(PlannerInfo *root, int extension_id)
Definition: extendplan.h:39
static GeqoPrivateData * GetGeqoPrivateData(PlannerInfo *root)
Definition: geqo.h:85
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
PGDLLIMPORT int Geqo_planner_extension_id
Definition: geqo_main.c:51
RelOptInfo * geqo(PlannerInfo *root, int number_of_rels, List *initial_rels)
Definition: geqo_main.c:74
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:261
tree ctl root
Definition: radixtree.h:1857
List * initial_rels
Definition: geqo.h:80
pg_prng_state random_state
Definition: geqo.h:81
Definition: pg_list.h:54

AltStyle によって変換されたページ (->オリジナル) /