]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
More optimizer cleanups.
authorBruce Momjian <bruce@momjian.us>
Thu, 4 Feb 1999 03:19:11 +0000 (03:19 +0000)
committerBruce Momjian <bruce@momjian.us>
Thu, 4 Feb 1999 03:19:11 +0000 (03:19 +0000)
src/backend/nodes/copyfuncs.c
src/backend/nodes/readfuncs.c
src/backend/optimizer/README
src/backend/optimizer/path/hashutils.c
src/backend/optimizer/path/joinpath.c
src/backend/optimizer/path/mergeutils.c
src/include/nodes/nodes.h
src/include/nodes/relation.h
src/include/optimizer/paths.h

index 7935d6b9951710c97848d5e34bba9af8511e424a..7b234224e1c172077fab8f1a2ccaf8d5b7514719 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.60 1999/02/04 01:46:53 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.61 1999/02/04 03:19:06 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -1397,13 +1397,13 @@ _copyHashInfo(HashInfo *from)
 }
 
 /* ----------------
- *             _copyMInfo
+ *             _copyMergeInfo
  * ----------------
  */
-static MInfo *
-_copyMInfo(MInfo *from)
+static MergeInfo *
+_copyMergeInfo(MergeInfo *from)
 {
-       MInfo      *newnode = makeNode(MInfo);
+       MergeInfo          *newnode = makeNode(MergeInfo);
 
        /* ----------------
         *      copy remainder of node
@@ -1800,8 +1800,8 @@ copyObject(void *from)
                case T_HashInfo:
                        retval = _copyHashInfo(from);
                        break;
-               case T_MInfo:
-                       retval = _copyMInfo(from);
+               case T_MergeInfo:
+                       retval = _copyMergeInfo(from);
                        break;
                case T_JoinInfo:
                        retval = _copyJoinInfo(from);
index fc7a1b443819f9489f6701518aaae9888dc9a353..f3ac661b0a44dd2136dd0b9fc229b20a7ac22139 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.47 1999/02/04 01:46:54 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.48 1999/02/04 03:19:06 momjian Exp $
  *
  * NOTES
  *       Most of the read functions for plan nodes are tested. (In fact, they
@@ -1914,7 +1914,7 @@ _readJoinMethod()
 static HashInfo *
 _readHashInfo()
 {
-       HashInfo           *local_node;
+       HashInfo        *local_node;
        char       *token;
        int                     length;
 
index bf67e97e382ca7bbd5f4ddfd3a33983c0e69d65c..6d9dae115c389f81e79112b19eef0ab7eff8b1b3 100644 (file)
@@ -1,3 +1,6 @@
+Optimizer Functions
+-------------------
+
 These directories take the Query structure returned by the parser, and
 generate a plan used by the executor.  The /plan directory generates the
 plan, the /path generates all possible ways to join the tables, and
@@ -93,9 +96,18 @@ planner()
 
 Optimizer Structures
 --------------------
-RelOptInfo             - info about every relation
-  RestrictInfo - info about restrictions
-  JoinInfo             - info about join combinations
-  Path                 - info about every way to access a relation(sequential, index)
-    PathOrder  - info about every ordering (sort, merge of relations)
+
+RelOptInfo             - Every relation
+
+ RestrictInfo  - restriction clauses
+ JoinInfo              - join combinations
+
+ Path                  - every way to access a relation(sequential, index)
+  IndexPath            - index scans
+
+  JoinPath             - joins
+   MergePath   - merge joins
+   HashPath            - hash joins
+
+ PathOrder             - every ordering type (sort, merge of relations)
 
index 4cdf4752d373f5a59624fc5455678b0dc11bfe83..1eebfa9b75d5d5e46b2660d6098ef8bfedb9755b 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/hashutils.c,v 1.10 1999/02/04 01:46:57 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/hashutils.c,v 1.11 1999/02/04 03:19:08 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -54,7 +54,7 @@ group_clauses_by_hashop(List *restrictinfo_list,
                 */
                if (hashjoinop)
                {
-                       HashInfo           *xhashinfo = (HashInfo *) NULL;
+                       HashInfo   *xhashinfo = (HashInfo *) NULL;
                        Expr       *clause = restrictinfo->clause;
                        Var                *leftop = get_leftop(clause);
                        Var                *rightop = get_rightop(clause);
index 991290178f6688247b94ce856fe19d67447d5e78..7a5f4889b16f02186c7d74abd734f69554bbb5e5 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.13 1999/02/04 01:46:57 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.14 1999/02/04 03:19:08 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -162,7 +162,6 @@ find_all_join_paths(Query *root, List *joinrels)
                temp_list = innerrel->pathlist;
                foreach(path, temp_list)
                {
-
                        /*
                         * XXX
                         *
@@ -235,7 +234,7 @@ sort_inner_and_outer(RelOptInfo * joinrel,
                                         List *mergeinfo_list)
 {
        List       *ms_list = NIL;
-       MInfo      *xmergeinfo = (MInfo *) NULL;
+       MergeInfo          *xmergeinfo = (MergeInfo *) NULL;
        MergePath  *temp_node = (MergePath *) NULL;
        List       *i;
        List       *outerkeys = NIL;
@@ -244,7 +243,7 @@ sort_inner_and_outer(RelOptInfo * joinrel,
 
        foreach(i, mergeinfo_list)
        {
-               xmergeinfo = (MInfo *) lfirst(i);
+               xmergeinfo = (MergeInfo *) lfirst(i);
 
                outerkeys = extract_path_keys(xmergeinfo->jmethod.jmkeys,
                                                          outerrel->targetlist,
@@ -325,7 +324,7 @@ match_unsorted_outer(RelOptInfo * joinrel,
                List       *clauses = NIL;
                List       *matchedJoinKeys = NIL;
                List       *matchedJoinClauses = NIL;
-               MInfo      *xmergeinfo = (MInfo *) NULL;
+               MergeInfo          *xmergeinfo = (MergeInfo *) NULL;
 
                outerpath = (Path *) lfirst(i);
 
@@ -465,7 +464,7 @@ match_unsorted_inner(RelOptInfo * joinrel,
 
        foreach(i, innerpath_list)
        {
-               MInfo      *xmergeinfo = (MInfo *) NULL;
+               MergeInfo          *xmergeinfo = (MergeInfo *) NULL;
                List       *clauses = NIL;
                List       *matchedJoinKeys = NIL;
                List       *matchedJoinClauses = NIL;
@@ -579,7 +578,7 @@ hash_inner_and_outer(RelOptInfo * joinrel,
                                         RelOptInfo * innerrel,
                                         List *hashinfo_list)
 {
-       HashInfo           *xhashinfo = (HashInfo *) NULL;
+       HashInfo   *xhashinfo = (HashInfo *) NULL;
        List       *hjoin_list = NIL;
        HashPath   *temp_node = (HashPath *) NULL;
        List       *i = NIL;
index 45882728b7f1a0f328d38e1a0eeafcb642a37f99..2896c4a6d81e60b935b145a90bb9f28ca1902e1a 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/mergeutils.c,v 1.11 1999/02/03 21:16:27 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/mergeutils.c,v 1.12 1999/02/04 03:19:09 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -53,7 +53,7 @@ group_clauses_by_order(List *restrictinfo_list,
                         * if one does not yet exist for this merge ordering.
                         */
                        PathOrder       p_ordering;
-                       MInfo      *xmergeinfo;
+                       MergeInfo          *xmergeinfo;
                        Expr       *clause = restrictinfo->clause;
                        Var                *leftop = get_leftop(clause);
                        Var                *rightop = get_rightop(clause);
@@ -77,7 +77,7 @@ group_clauses_by_order(List *restrictinfo_list,
 
                        if (xmergeinfo == NULL)
                        {
-                               xmergeinfo = makeNode(MInfo);
+                               xmergeinfo = makeNode(MergeInfo);
 
                                xmergeinfo->m_ordering = merge_ordering;
                                mergeinfo_list = lcons(xmergeinfo,
@@ -102,7 +102,7 @@ group_clauses_by_order(List *restrictinfo_list,
  * Returns the node if it exists.
  *
  */
-MInfo *
+MergeInfo *
 match_order_mergeinfo(PathOrder *ordering, List *mergeinfo_list)
 {
        MergeOrder *xmergeorder;
@@ -110,7 +110,7 @@ match_order_mergeinfo(PathOrder *ordering, List *mergeinfo_list)
 
        foreach(xmergeinfo, mergeinfo_list)
        {
-               MInfo      *mergeinfo = (MInfo *) lfirst(xmergeinfo);
+               MergeInfo          *mergeinfo = (MergeInfo *) lfirst(xmergeinfo);
 
                xmergeorder = mergeinfo->m_ordering;
 
@@ -123,5 +123,5 @@ match_order_mergeinfo(PathOrder *ordering, List *mergeinfo_list)
                        return mergeinfo;
                }
        }
-       return (MInfo *) NIL;
+       return (MergeInfo *) NIL;
 }
index e0c45ea9e160f08c146577e199e6ccfdcbd2342c..d001c33c991b4f9a4d06762f2566b18abf3c6b42 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: nodes.h,v 1.37 1999/02/04 01:47:00 momjian Exp $
+ * $Id: nodes.h,v 1.38 1999/02/04 03:19:10 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -82,7 +82,7 @@ typedef enum NodeTag
        T_RestrictInfo,
        T_JoinMethod,
        T_HashInfo,
-       T_MInfo,
+       T_MergeInfo,
        T_JoinInfo,
        T_Iter,
        T_Stream,
index b0feae341f237e2653d4972b3f49b3239d086223..45bb715e671a44d701ff349f9854fdd8494a0f14 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: relation.h,v 1.13 1999/02/04 01:47:02 momjian Exp $
+ * $Id: relation.h,v 1.14 1999/02/04 03:19:10 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -47,7 +47,7 @@ typedef List *Relid;
  *                                             leaves the tuples unordered)
  *             cheapestpath -  least expensive Path (regardless of final order)
  *             pruneable - flag to let the planner know whether it can prune the plan
- *                                     space of this RelOptInfo or not.  -- JMH, 11/11/92
+ *                                     space of this RelOptInfo or not.
  *
  *      * If the relation is a (secondary) index it will have the following
  *             three fields:
@@ -157,8 +157,7 @@ typedef struct IndexPath
        Path            path;
        List       *indexid;
        List       *indexqual;
-       int                *indexkeys;          /* to transform heap attnos into index
-                                                                * ones */
+       int                *indexkeys;  /* to transform heap attnos into index ones */
 } IndexPath;
 
 typedef struct JoinPath
@@ -236,11 +235,11 @@ typedef struct HashInfo
        Oid                     hashop;
 } HashInfo;
 
-typedef struct MInfo
+typedef struct MergeInfo
 {
        JoinMethod      jmethod;
        MergeOrder *m_ordering;
-} MInfo;
+} MergeInfo;
 
 typedef struct JoinInfo
 {
index 99f2edc488dc57b75dfbf052ab578da92137f315..babcd84eaaa4332516c9708694f37854783afad6 100644 (file)
@@ -7,7 +7,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: paths.h,v 1.11 1999/02/03 20:15:53 momjian Exp $
+ * $Id: paths.h,v 1.12 1999/02/04 03:19:11 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -70,7 +70,7 @@ extern List *new_join_pathkeys(List *outer_pathkeys,
  */
 extern List *group_clauses_by_order(List *restrictinfo_list,
                                           int inner_relid);
-extern MInfo *match_order_mergeinfo(PathOrder *ordering,
+extern MergeInfo *match_order_mergeinfo(PathOrder *ordering,
                                          List *mergeinfo_list);
 
 /*