1997-02-19 13:59:07 +01:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
1999-02-14 00:22:53 +01:00
|
|
|
* geqo.h
|
1997-09-07 07:04:48 +02:00
|
|
|
* prototypes for various files in optimizer/geqo
|
1997-02-19 13:59:07 +01:00
|
|
|
*
|
2001-01-24 20:43:33 +01:00
|
|
|
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
|
2000-01-26 06:58:53 +01:00
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
1997-02-19 13:59:07 +01:00
|
|
|
*
|
2001-03-22 05:01:46 +01:00
|
|
|
* $Id: geqo.h,v 1.24 2001/03/22 04:00:53 momjian Exp $
|
1997-02-19 13:59:07 +01:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* contributed by:
|
|
|
|
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
|
1997-09-07 07:04:48 +02:00
|
|
|
* Martin Utesch * Institute of Automatic Control *
|
|
|
|
= = University of Mining and Technology =
|
|
|
|
* utesch@aut.tu-freiberg.de * Freiberg, Germany *
|
1997-02-19 13:59:07 +01:00
|
|
|
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
|
|
|
|
*/
|
|
|
|
|
1997-09-07 07:04:48 +02:00
|
|
|
#ifndef GEQO_H
|
|
|
|
#define GEQO_H
|
1997-02-19 13:59:07 +01:00
|
|
|
|
1997-11-26 02:14:33 +01:00
|
|
|
#include "nodes/relation.h"
|
|
|
|
#include "optimizer/geqo_gene.h"
|
1997-02-19 13:59:07 +01:00
|
|
|
|
|
|
|
/* GEQO debug flag */
|
|
|
|
/*
|
|
|
|
#define GEQO_DEBUG
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* recombination mechanism */
|
|
|
|
/*
|
|
|
|
#define ERX
|
|
|
|
#define PMX
|
|
|
|
#define CX
|
|
|
|
#define PX
|
|
|
|
#define OX1
|
|
|
|
#define OX2
|
|
|
|
*/
|
|
|
|
#define ERX
|
|
|
|
|
|
|
|
|
2000-05-31 02:28:42 +02:00
|
|
|
/*
|
|
|
|
* Configuration options
|
|
|
|
*/
|
2001-01-24 19:37:31 +01:00
|
|
|
/* If you change these, update backend/utils/misc/postgresql.sample.conf */
|
2001-03-22 05:01:46 +01:00
|
|
|
extern int Geqo_pool_size;
|
|
|
|
|
|
|
|
#define DEFAULT_GEQO_POOL_SIZE 0/* = default based on no. of relations. */
|
2000-05-31 02:28:42 +02:00
|
|
|
#define MIN_GEQO_POOL_SIZE 128
|
|
|
|
#define MAX_GEQO_POOL_SIZE 1024
|
1997-02-19 13:59:07 +01:00
|
|
|
|
2001-03-22 05:01:46 +01:00
|
|
|
extern int Geqo_effort; /* 1 .. inf, only used to calculate
|
|
|
|
* generations default */
|
|
|
|
extern int Geqo_generations; /* 1 .. inf, or 0 to use default based on
|
|
|
|
* pool size */
|
|
|
|
|
|
|
|
extern double Geqo_selection_bias;
|
1997-02-19 13:59:07 +01:00
|
|
|
|
2001-01-24 19:37:31 +01:00
|
|
|
/* If you change these, update backend/utils/misc/postgresql.sample.conf */
|
2000-05-31 02:28:42 +02:00
|
|
|
#define DEFAULT_GEQO_SELECTION_BIAS 2.0
|
|
|
|
#define MIN_GEQO_SELECTION_BIAS 1.5
|
|
|
|
#define MAX_GEQO_SELECTION_BIAS 2.0
|
1997-02-19 13:59:07 +01:00
|
|
|
|
2001-03-22 05:01:46 +01:00
|
|
|
extern int Geqo_random_seed; /* or negative to use current time */
|
1997-02-19 13:59:07 +01:00
|
|
|
|
|
|
|
|
1999-05-17 02:25:34 +02:00
|
|
|
/* routines in geqo_main.c */
|
2000-09-19 20:42:34 +02:00
|
|
|
extern RelOptInfo *geqo(Query *root, int number_of_rels, List *initial_rels);
|
1997-02-19 13:59:07 +01:00
|
|
|
|
1999-05-17 02:25:34 +02:00
|
|
|
/* routines in geqo_eval.c */
|
2000-09-19 20:42:34 +02:00
|
|
|
extern Cost geqo_eval(Query *root, List *initial_rels,
|
2001-03-22 05:01:46 +01:00
|
|
|
Gene *tour, int num_gene);
|
2000-09-19 20:42:34 +02:00
|
|
|
extern RelOptInfo *gimme_tree(Query *root, List *initial_rels,
|
2001-03-22 05:01:46 +01:00
|
|
|
Gene *tour, int num_gene,
|
|
|
|
int rel_count, RelOptInfo *old_rel);
|
1997-02-19 13:59:07 +01:00
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
#endif /* GEQO_H */
|