mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-21 08:29:39 +08:00
OPTIMIZER_DEBUG additions.
This commit is contained in:
parent
af5fde7491
commit
e46df2ff6e
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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));
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -7,10 +7,6 @@ Inches
|
||||
0 0 2.00 150.00 180.00
|
||||
0 0 2.00 150.00 180.00
|
||||
7950 10200 7950 10800
|
||||
2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1
|
||||
8400 375
|
||||
2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1
|
||||
8400 375
|
||||
2 4 0 1 -1 29 0 0 20 0.000 0 0 7 0 0 5
|
||||
2775 11400 375 11400 375 10800 2775 10800 2775 11400
|
||||
2 1 0 2 29 7 0 0 -1 0.000 0 0 -1 1 1 2
|
||||
@ -73,10 +69,6 @@ Inches
|
||||
2 1 0 2 20 7 0 0 -1 0.000 0 0 -1 1 0 2
|
||||
0 0 2.00 150.00 180.00
|
||||
2550 2175 6450 2775
|
||||
2 1 1 2 -1 7 0 0 -1 4.000 0 0 -1 1 1 2
|
||||
0 0 2.00 150.00 180.00
|
||||
0 0 2.00 150.00 180.00
|
||||
4815 1908 5250 1350
|
||||
2 4 0 1 -1 29 0 0 20 0.000 0 0 7 0 0 5
|
||||
7650 12600 5250 12600 5250 12000 7650 12000 7650 12600
|
||||
2 1 0 2 29 7 0 0 -1 0.000 0 0 -1 1 1 2
|
||||
@ -88,16 +80,20 @@ Inches
|
||||
3750 5775 5250 5775
|
||||
2 4 0 1 -1 8 0 0 20 0.000 0 0 7 0 0 5
|
||||
3750 6075 1350 6075 1350 5475 3750 5475 3750 6075
|
||||
2 1 1 2 -1 7 0 0 -1 3.000 0 0 -1 1 1 2
|
||||
0 0 2.00 150.00 180.00
|
||||
0 0 2.00 150.00 180.00
|
||||
4660 1524 5295 1293
|
||||
2 1 0 2 8 7 0 0 -1 0.000 0 0 -1 1 0 2
|
||||
0 0 2.00 150.00 180.00
|
||||
2550 7275 2550 7875
|
||||
2 1 0 2 31 7 0 0 -1 0.000 0 0 -1 1 0 2
|
||||
0 0 2.00 150.00 180.00
|
||||
2550 3300 2550 4275
|
||||
2 1 2 2 -1 7 0 0 -1 4.000 0 1 -1 1 1 2
|
||||
0 0 2.00 80.00 150.00
|
||||
0 0 2.00 80.00 150.00
|
||||
4800 1875 5235 1317
|
||||
2 1 2 2 -1 7 0 0 -1 3.000 0 1 -1 1 1 2
|
||||
0 0 2.00 80.00 150.00
|
||||
0 0 2.00 80.00 150.00
|
||||
4584 1524 5219 1293
|
||||
3 0 0 2 8 7 0 0 -1 0.000 0 1 0 8
|
||||
0 0 2.00 150.00 150.00
|
||||
1350 9375 1050 9375 825 9000 825 4425 1050 4050 1500 3975
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 69 KiB |
@ -16,23 +16,23 @@ by Bruce Momjian
|
||||
<IMG src="flow.jpg" usemap="#flowmap" alt="flowchart" border=0>
|
||||
</CENTER>
|
||||
<MAP name="flowmap">
|
||||
<AREA COORDS="80,10,240,50" HREF="backend_dirs.html#main">
|
||||
<AREA COORDS="80,90,240,130" HREF="backend_dirs.html#postmaster">
|
||||
<AREA COORDS="340,50,500,90" HREF="backend_dirs.html#libpq">
|
||||
<AREA COORDS="80,170,240,210" HREF="backend_dirs.html#tcop">
|
||||
<AREA COORDS="340,170,500,210" HREF="backend_dirs.html#tcop">
|
||||
<AREA COORDS="80,270,240,310" HREF="backend_dirs.html#parser">
|
||||
<AREA COORDS="80,350,240,390" HREF="backend_dirs.html#tcop">
|
||||
<AREA COORDS="80,430,240,470" HREF="backend_dirs.html#optimizer">
|
||||
<AREA COORDS="80,410,240,550" HREF="backend_dirs.html#optimizer/plan">
|
||||
<AREA COORDS="80,590,240,630" HREF="backend_dirs.html#executor">
|
||||
<AREA COORDS="340,350,500,390" HREF="backend_dirs.html#commands">
|
||||
<AREA COORDS="10,700,170,750" HREF="backend_dirs.html#utils">
|
||||
<AREA COORDS="220,700,380,740" HREF="backend_dirs.html#catalog">
|
||||
<AREA COORDS="430,700,600,750" HREF="backend_dirs.html#storage">
|
||||
<AREA COORDS="110,780,280,830" HREF="backend_dirs.html#access">
|
||||
<AREA COORDS="340,780,500,830" HREF="backend_dirs.html#nodes">
|
||||
<AREA COORDS="20,870,180,910" HREF="backend_dirs.html#bootstrap">
|
||||
<AREA COORDS="70,0,230,40" HREF="backend_dirs.html#main">
|
||||
<AREA COORDS="70,80,230,120" HREF="backend_dirs.html#postmaster">
|
||||
<AREA COORDS="330,40,490,80" HREF="backend_dirs.html#libpq">
|
||||
<AREA COORDS="70,160,230,200" HREF="backend_dirs.html#tcop">
|
||||
<AREA COORDS="330,160,490,200" HREF="backend_dirs.html#tcop">
|
||||
<AREA COORDS="70,260,230,300" HREF="backend_dirs.html#parser">
|
||||
<AREA COORDS="70,340,230,380" HREF="backend_dirs.html#tcop">
|
||||
<AREA COORDS="70,420,230,460" HREF="backend_dirs.html#optimizer">
|
||||
<AREA COORDS="70,400,230,540" HREF="backend_dirs.html#optimizer/plan">
|
||||
<AREA COORDS="70,580,230,620" HREF="backend_dirs.html#executor">
|
||||
<AREA COORDS="330,340,490,380" HREF="backend_dirs.html#commands">
|
||||
<AREA COORDS="0,690,160,740" HREF="backend_dirs.html#utils">
|
||||
<AREA COORDS="210,690,370,730" HREF="backend_dirs.html#catalog">
|
||||
<AREA COORDS="420,690,590,740" HREF="backend_dirs.html#storage">
|
||||
<AREA COORDS="100,770,270,820" HREF="backend_dirs.html#access">
|
||||
<AREA COORDS="330,770,490,820" HREF="backend_dirs.html#nodes">
|
||||
<AREA COORDS="10,860,170,900" HREF="backend_dirs.html#bootstrap">
|
||||
</MAP>
|
||||
<CENTER><EM>
|
||||
Click on an item to see more detail or look at the full
|
||||
|
Loading…
Reference in New Issue
Block a user