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
|
|
|
*
|
2003-08-04 04:40:20 +02:00
|
|
|
* Portions Copyright (c) 1996-2003, 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
|
|
|
*
|
2003-11-29 23:41:33 +01:00
|
|
|
* $PostgreSQL: pgsql/src/include/optimizer/geqo.h,v 1.33 2003/11/29 22:41:07 pgsql 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
|
2002-07-20 06:59:10 +02:00
|
|
|
*/
|
1997-02-19 13:59:07 +01:00
|
|
|
|
|
|
|
/* 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;
|
|
|
|
|
2001-10-28 07:26:15 +01:00
|
|
|
#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
|
|
|
|
|
|
|
|
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,
|
Fix GEQO to work again in CVS tip, by being more careful about memory
allocation in best_inner_indexscan(). While at it, simplify GEQO's
interface to the main planner --- make_join_rel() offers exactly the
API it really wants, whereas calling make_rels_by_clause_joins() and
make_rels_by_clauseless_joins() required jumping through hoops.
Rewrite gimme_tree for clarity (sometimes iteration is much better than
recursion), and approximately halve GEQO's runtime by recognizing that
tours of the forms (a,b,c,d,...) and (b,a,c,d,...) are equivalent
because of symmetry in make_join_rel().
2002-12-16 22:30:30 +01:00
|
|
|
Gene *tour, int num_gene);
|
2001-10-28 07:26:15 +01:00
|
|
|
|
2001-11-05 18:46:40 +01:00
|
|
|
#endif /* GEQO_H */
|