1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-27 00:12:01 +03:00

Fix GEQO optimizer to work correctly with new outer-join-capable

query representation.  Note that GEQO_RELS setting is now interpreted
as the number of top-level items in the FROM list, not necessarily the
number of relations in the query.  This seems appropriate since we are
only doing join-path searching over the top-level items.
This commit is contained in:
Tom Lane
2000-09-19 18:42:34 +00:00
parent 457ac0331c
commit ba2ea6e0f5
6 changed files with 57 additions and 48 deletions

View File

@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: geqo.h,v 1.20 2000/06/28 03:33:22 tgl Exp $
* $Id: geqo.h,v 1.21 2000/09/19 18:42:32 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -62,11 +62,13 @@ extern int Geqo_random_seed; /* or negative to use current time */
/* routines in geqo_main.c */
extern RelOptInfo *geqo(Query *root);
extern RelOptInfo *geqo(Query *root, int number_of_rels, List *initial_rels);
/* routines in geqo_eval.c */
extern Cost geqo_eval(Query *root, Gene *tour, int num_gene);
extern RelOptInfo *gimme_tree(Query *root, Gene *tour, int rel_count,
int num_gene, RelOptInfo *old_rel);
extern Cost geqo_eval(Query *root, List *initial_rels,
Gene *tour, int num_gene);
extern RelOptInfo *gimme_tree(Query *root, List *initial_rels,
Gene *tour, int num_gene,
int rel_count, RelOptInfo *old_rel);
#endif /* GEQO_H */

View File

@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: geqo_pool.h,v 1.9 2000/01/26 05:58:20 momjian Exp $
* $Id: geqo_pool.h,v 1.10 2000/09/19 18:42:32 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -29,7 +29,8 @@
extern Pool *alloc_pool(int pool_size, int string_length);
extern void free_pool(Pool *pool);
extern void random_init_pool(Query *root, Pool *pool, int strt, int stop);
extern void random_init_pool(Query *root, List *initial_rels,
Pool *pool, int strt, int stop);
extern Chromosome *alloc_chromo(int string_length);
extern void free_chromo(Chromosome *chromo);