1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-11 00:12:06 +03:00

OPTIMIZER_DEBUG additions.

This commit is contained in:
Bruce Momjian
1998-08-07 05:02:32 +00:00
parent af5fde7491
commit e46df2ff6e
8 changed files with 42 additions and 44 deletions

View File

@@ -9,6 +9,7 @@ planner()
preprocess target list
preprocess qualifications(WHERE)
--query_planner()
cnfify qualification, so qual are expressions (were AND's) and OR clauses
pull out constants from target list
get a target list that only contains column names, no expressions
if none, then return

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.18 1998/08/04 00:42:07 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.19 1998/08/07 05:02:15 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -45,6 +45,7 @@ int32 _use_geqo_rels_ = GEQO_RELS;
static void find_rel_paths(Query *root, List *rels);
static List *find_join_paths(Query *root, List *outer_rels, int levels_needed);
static void debug_print_rel(Query *root, RelOptInfo *rel);
/*
* find-paths--
@@ -173,7 +174,7 @@ find_join_paths(Query *root, List *outer_rels, int levels_needed)
{
List *x;
List *new_rels = NIL;
RelOptInfo *rel;
RelOptInfo *rel;
/*******************************************
* genetic query optimizer entry point *
@@ -236,7 +237,7 @@ find_join_paths(Query *root, List *outer_rels, int levels_needed)
/* #define OPTIMIZER_DEBUG */
#ifdef OPTIMIZER_DEBUG
printf("levels left: %d\n", levels_left);
printf("levels left: %d\n", levels_needed);
debug_print_rel(root, rel);
#endif
}

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/initsplan.c,v 1.14 1998/08/04 16:44:14 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/initsplan.c,v 1.15 1998/08/07 05:02:17 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -36,8 +36,7 @@
extern int Quiet;
static void add_clause_to_rels(Query *root, List *clause);
static void
add_join_clause_info_to_rels(Query *root, CInfo *clauseinfo,
static void add_join_clause_info_to_rels(Query *root, CInfo *clauseinfo,
List *join_relids);
static void add_vars_to_rels(Query *root, List *vars, List *join_relids);
@@ -183,8 +182,6 @@ add_clause_to_rels(Query *root, List *clause)
clauseinfo->mergejoinorder = (MergeOrder *) NULL;
clauseinfo->hashjoinoperator = (Oid) 0;
if (length(relids) == 1)
{
RelOptInfo *rel = get_base_rel(root, lfirsti(relids));

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planmain.c,v 1.23 1998/07/18 04:22:37 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planmain.c,v 1.24 1998/08/07 05:02:19 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -18,6 +18,7 @@
#include "nodes/pg_list.h"
#include "nodes/plannodes.h"
#include "nodes/parsenodes.h"
#include "nodes/print.h"
#include "nodes/relation.h"
#include "nodes/makefuncs.h"
@@ -85,7 +86,11 @@ query_planner(Query *root,
qual = (List *) SS_process_sublinks((Node *) qual);
qual = cnfify((Expr *) qual, true);
#ifdef OPTIMIZER_DEBUG
printf("After cnfify()\n");
pprint(qual);
#endif
/*
* A command without a target list or qualification is an error,
* except for "delete foo".
@@ -250,8 +255,8 @@ subplanner(Query *root,
List *flat_tlist,
List *qual)
{
RelOptInfo *final_relation;
List *final_relation_list;
RelOptInfo *final_relation;
List *final_relation_list;
/*
* Initialize the targetlist and qualification, adding entries to

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.17 1998/06/15 19:28:47 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.18 1998/08/07 05:02:22 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -350,8 +350,6 @@ pull_constant_clauses(List *quals, List **constantQual)
*
* Returns the list of relids and vars.
*
* XXX take the nreverse's out later
*
*/
void
clause_relids_vars(Node *clause, List **relids, List **vars)