Rename Temp to Noname for noname tables.
authorBruce Momjian
Tue, 9 Feb 1999 17:03:14 +0000 (17:03 +0000)
committerBruce Momjian
Tue, 9 Feb 1999 17:03:14 +0000 (17:03 +0000)
21 files changed:
src/backend/catalog/heap.c
src/backend/commands/explain.c
src/backend/executor/execAmi.c
src/backend/executor/nodeMaterial.c
src/backend/executor/nodeSort.c
src/backend/nodes/copyfuncs.c
src/backend/nodes/freefuncs.c
src/backend/nodes/outfuncs.c
src/backend/nodes/print.c
src/backend/nodes/readfuncs.c
src/backend/optimizer/path/costsize.c
src/backend/optimizer/path/joinutils.c
src/backend/optimizer/plan/createplan.c
src/backend/optimizer/plan/planmain.c
src/backend/optimizer/plan/planner.c
src/backend/optimizer/plan/setrefs.c
src/backend/optimizer/util/relnode.c
src/include/nodes/nodes.h
src/include/nodes/plannodes.h
src/include/optimizer/internal.h
src/include/optimizer/planmain.h

index 2b20186d2fdda1d695a6bea412bf254558455d3b..52d40091041bdafcdf5501378f452ec25a6a168e 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.72 1999/02/03 21:15:54 momjian Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.73 1999/02/09 17:02:42 momjian Exp $
  *
  *
  * INTERFACE ROUTINES
@@ -149,7 +149,7 @@ typedef struct tempRelList
                                 * array */
 } TempRelList;
 
-#define TEMP_REL_LIST_SIZE 32
+#define NONAME_REL_LIST_SIZE   32
 
 static TempRelList *tempRels = NULL;
 
@@ -1392,7 +1392,7 @@ InitNoNameRelList(void)
    }
 
    tempRels = (TempRelList *) malloc(sizeof(TempRelList));
-   tempRels->size = TEMP_REL_LIST_SIZE;
+   tempRels->size = NONAME_REL_LIST_SIZE;
    tempRels->rels = (Relation *) malloc(sizeof(Relation) * tempRels->size);
    MemSet(tempRels->rels, 0, sizeof(Relation) * tempRels->size);
    tempRels->num = 0;
@@ -1436,7 +1436,7 @@ AddToNoNameRelList(Relation r)
 
    if (tempRels->num == tempRels->size)
    {
-       tempRels->size += TEMP_REL_LIST_SIZE;
+       tempRels->size += NONAME_REL_LIST_SIZE;
        tempRels->rels = realloc(tempRels->rels,
                                 sizeof(Relation) * tempRels->size);
    }
index 8781458548ae2559f63312929b002274e73d314c..579626ec33b3b9d49500f1184ffa96e2b5a27216 100644 (file)
@@ -4,7 +4,7 @@
  *
  * Copyright (c) 1994-5, Regents of the University of California
  *
- *   $Id: explain.c,v 1.30 1998/12/18 14:45:07 wieck Exp $
+ *   $Id: explain.c,v 1.31 1999/02/09 17:02:43 momjian Exp $
  *
  */
 #include 
@@ -176,8 +176,8 @@ explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es)
        case T_IndexScan:
            pname = "Index Scan";
            break;
-       case T_Temp:
-           pname = "Temp Scan";
+       case T_Noname:
+           pname = "Noname Scan";
            break;
        case T_Sort:
            pname = "Sort";
index 1e985edbef63a9d3bcda0c75b7c5843bde77a9ad..8ea66c3a2c4ffc2176707ceafeea500700b21ecb 100644 (file)
@@ -5,7 +5,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- *  $Id: execAmi.c,v 1.30 1999/02/02 03:44:23 momjian Exp $
+ *  $Id: execAmi.c,v 1.31 1999/02/09 17:02:44 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -50,7 +50,7 @@
 #include "executor/nodeAppend.h"
 #include "executor/nodeSubplan.h"
 #include "executor/execdebug.h"
-#include "optimizer/internal.h" /* for _TEMP_RELATION_ID_ */
+#include "optimizer/internal.h" /* for _NONAME_RELATION_ID_ */
 #include "access/genam.h"
 #include "access/heapam.h"
 #include "catalog/heap.h"
@@ -509,11 +509,11 @@ ExecCreatR(TupleDesc tupType,
 
    relDesc = NULL;
 
-   if (relationOid == _TEMP_RELATION_ID_)
+   if (relationOid == _NONAME_RELATION_ID_)
    {
        /* ----------------
         *   create a temporary relation
-        *   (currently the planner always puts a _TEMP_RELATION_ID
+        *   (currently the planner always puts a _NONAME_RELATION_ID
         *   in the relation argument so we expect this to be the case although
         *   it's possible that someday we'll get the name from
         *   from the range table.. -cim 10/12/89)
index 87974668bb02f0edafd2d979a624f4aab13236fe..c4171c7a1bc16ba32e63c4bac911e90e1d8cf966 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/backend/executor/nodeMaterial.c,v 1.19 1999/02/03 21:16:14 momjian Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/executor/nodeMaterial.c,v 1.20 1999/02/09 17:02:44 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -25,7 +25,7 @@
 #include "executor/nodeMaterial.h"
 #include "catalog/catalog.h"
 #include "catalog/heap.h"
-#include "optimizer/internal.h" /* for _TEMP_RELATION_ID_ */
+#include "optimizer/internal.h" /* for _NONAME_RELATION_ID_ */
 #include "access/heapam.h"
 
 /* ----------------------------------------------------------------
@@ -265,7 +265,7 @@ ExecInitMaterial(Material *node, EState *estate, Plan *parent)
 
    /* ----------------
     *  ExecCreatR wants it's second argument to be an object id of
-    *  a relation in the range table or a _TEMP_RELATION_ID
+    *  a relation in the range table or a _NONAME_RELATION_ID
     *  indicating that the relation is not in the range table.
     *
     *  In the second case ExecCreatR creates a temp relation.
@@ -277,7 +277,7 @@ ExecInitMaterial(Material *node, EState *estate, Plan *parent)
     * ----------------
     */
 /*   len = ExecTargetListLength(node->plan.targetlist); */
-   tempDesc = ExecCreatR(tupType, _TEMP_RELATION_ID_);
+   tempDesc = ExecCreatR(tupType, _NONAME_RELATION_ID_);
 
    /* ----------------
     *  save the relation descriptor in the sortstate
index dd9ca22c656ca1fb61ba417ea80740aefbcda2a0..b264105f476dc3690fecc5fc1eef1a9e9c08b9d5 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/backend/executor/nodeSort.c,v 1.16 1998/09/01 03:22:30 momjian Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/executor/nodeSort.c,v 1.17 1999/02/09 17:02:45 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -22,7 +22,7 @@
 #include "catalog/catalog.h"
 #include "catalog/heap.h"
 #include "storage/bufmgr.h"
-#include "optimizer/internal.h" /* for _TEMP_RELATION_ID_ */
+#include "optimizer/internal.h" /* for _NONAME_RELATION_ID_ */
 
 /* ----------------------------------------------------------------
  *     FormSortKeys(node)
index 23f9e424d1428f64757587f6c9fa12fd68fc3fbe..8a0ac031fb7bc12fe7643db93c4197ef5b145163 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.64 1999/02/09 03:51:12 momjian Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.65 1999/02/09 17:02:46 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -372,36 +372,36 @@ _copyHashJoin(HashJoin *from)
 
 
 /* ----------------
- *     CopyTempFields
+ *     CopyNonameFields
  *
- *     This function copies the fields of the Temp node.  It is used by
- *     all the copy functions for classes which inherit from Temp.
+ *     This function copies the fields of the Noname node.  It is used by
+ *     all the copy functions for classes which inherit from Noname.
  * ----------------
  */
 static void
-CopyTempFields(Temp *from, Temp *newnode)
+CopyNonameFields(Noname *from, Noname *newnode)
 {
-   newnode->tempid = from->tempid;
+   newnode->nonameid = from->nonameid;
    newnode->keycount = from->keycount;
    return;
 }
 
 
 /* ----------------
- *     _copyTemp
+ *     _copyNoname
  * ----------------
  */
-static Temp *
-_copyTemp(Temp *from)
+static Noname *
+_copyNoname(Noname *from)
 {
-   Temp       *newnode = makeNode(Temp);
+   Noname     *newnode = makeNode(Noname);
 
    /* ----------------
     *  copy node superclass fields
     * ----------------
     */
    CopyPlanFields((Plan *) from, (Plan *) newnode);
-   CopyTempFields(from, newnode);
+   CopyNonameFields(from, newnode);
 
    return newnode;
 }
@@ -420,7 +420,7 @@ _copyMaterial(Material *from)
     * ----------------
     */
    CopyPlanFields((Plan *) from, (Plan *) newnode);
-   CopyTempFields((Temp *) from, (Temp *) newnode);
+   CopyNonameFields((Noname *) from, (Noname *) newnode);
 
    return newnode;
 }
@@ -440,7 +440,7 @@ _copySort(Sort *from)
     * ----------------
     */
    CopyPlanFields((Plan *) from, (Plan *) newnode);
-   CopyTempFields((Temp *) from, (Temp *) newnode);
+   CopyNonameFields((Noname *) from, (Noname *) newnode);
 
    return newnode;
 }
@@ -511,7 +511,7 @@ _copyUnique(Unique *from)
     * ----------------
     */
    CopyPlanFields((Plan *) from, (Plan *) newnode);
-   CopyTempFields((Temp *) from, (Temp *) newnode);
+   CopyNonameFields((Noname *) from, (Noname *) newnode);
 
    /* ----------------
     *  copy remainder of node
@@ -1688,8 +1688,8 @@ copyObject(void *from)
        case T_HashJoin:
            retval = _copyHashJoin(from);
            break;
-       case T_Temp:
-           retval = _copyTemp(from);
+       case T_Noname:
+           retval = _copyNoname(from);
            break;
        case T_Material:
            retval = _copyMaterial(from);
index 1a0b2ca754754275d9aa15f0d9eff67c7e8d8d36..a7d3bf6305b0d8ef84144fee82532eb2df397bc6 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/backend/nodes/Attic/freefuncs.c,v 1.3 1999/02/09 03:51:12 momjian Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/nodes/Attic/freefuncs.c,v 1.4 1999/02/09 17:02:49 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -298,32 +298,32 @@ _freeHashJoin(HashJoin *node)
 
 
 /* ----------------
- *     FreeTempFields
+ *     FreeNonameFields
  *
- *     This function frees the fields of the Temp node.  It is used by
- *     all the free functions for classes which inherit node Temp.
+ *     This function frees the fields of the Noname node.  It is used by
+ *     all the free functions for classes which inherit node Noname.
  * ----------------
  */
 static void
-FreeTempFields(Temp *node)
+FreeNonameFields(Noname *node)
 {
    return;
 }
 
 
 /* ----------------
- *     _freeTemp
+ *     _freeNoname
  * ----------------
  */
 static void
-_freeTemp(Temp *node)
+_freeNoname(Noname *node)
 {
    /* ----------------
     *  free node superclass fields
     * ----------------
     */
    FreePlanFields((Plan *) node);
-   FreeTempFields(node);
+   FreeNonameFields(node);
 
    pfree(node);
 }
@@ -340,7 +340,7 @@ _freeMaterial(Material *node)
     * ----------------
     */
    FreePlanFields((Plan *) node);
-   FreeTempFields((Temp *) node);
+   FreeNonameFields((Noname *) node);
 
    pfree(node);
 }
@@ -358,7 +358,7 @@ _freeSort(Sort *node)
     * ----------------
     */
    FreePlanFields((Plan *) node);
-   FreeTempFields((Temp *) node);
+   FreeNonameFields((Noname *) node);
 
    pfree(node);
 }
@@ -417,7 +417,7 @@ _freeUnique(Unique *node)
     * ----------------
     */
    FreePlanFields((Plan *) node);
-   FreeTempFields((Temp *) node);
+   FreeNonameFields((Noname *) node);
 
    /* ----------------
     *  free remainder of node
@@ -1207,8 +1207,8 @@ freeObject(void *node)
        case T_HashJoin:
            _freeHashJoin(node);
            break;
-       case T_Temp:
-           _freeTemp(node);
+       case T_Noname:
+           _freeNoname(node);
            break;
        case T_Material:
            _freeMaterial(node);
index ef3dccab35de3ea9952c0097edeccf08c0ee91fc..854a2011cb3528e674cdb1684cc318f4808f6b6e 100644 (file)
@@ -5,7 +5,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- *  $Id: outfuncs.c,v 1.66 1999/02/09 03:51:13 momjian Exp $
+ *  $Id: outfuncs.c,v 1.67 1999/02/09 17:02:49 momjian Exp $
  *
  * NOTES
  *   Every (plan) node in POSTGRES has an associated "out" routine which
@@ -472,21 +472,21 @@ _outIndexScan(StringInfo str, IndexScan *node)
 }
 
 /*
- * Temp is a subclass of Plan
+ * Noname is a subclass of Plan
  */
 static void
-_outTemp(StringInfo str, Temp *node)
+_outNoname(StringInfo str, Noname *node)
 {
-   appendStringInfo(str, " TEMP ");
+   appendStringInfo(str, " NONAME ");
    _outPlanInfo(str, (Plan *) node);
 
-   appendStringInfo(str, " :tempid %u :keycount %d ", 
-           node->tempid,
+   appendStringInfo(str, " :nonameid %u :keycount %d ", 
+           node->nonameid,
            node->keycount);
 }
 
 /*
- * Sort is a subclass of Temp
+ * Sort is a subclass of Noname
  */
 static void
 _outSort(StringInfo str, Sort *node)
@@ -494,8 +494,8 @@ _outSort(StringInfo str, Sort *node)
    appendStringInfo(str, " SORT ");
    _outPlanInfo(str, (Plan *) node);
 
-   appendStringInfo(str, " :tempid %u :keycount %d ",
-           node->tempid,
+   appendStringInfo(str, " :nonameid %u :keycount %d ",
+           node->nonameid,
            node->keycount);
 }
 
@@ -523,7 +523,7 @@ _outGroup(StringInfo str, Group *node)
 }
 
 /*
- * For some reason, unique is a subclass of Temp.
+ * For some reason, unique is a subclass of Noname.
  */
 static void
 _outUnique(StringInfo str, Unique *node)
@@ -531,14 +531,14 @@ _outUnique(StringInfo str, Unique *node)
    appendStringInfo(str, " UNIQUE ");
    _outPlanInfo(str, (Plan *) node);
 
-   appendStringInfo(str, " :tempid %u :keycount %d ",
-           node->tempid,
+   appendStringInfo(str, " :nonameid %u :keycount %d ",
+           node->nonameid,
            node->keycount);
 }
 
 
 /*
- * Hash is a subclass of Temp
+ * Hash is a subclass of Noname
  */
 static void
 _outHash(StringInfo str, Hash *node)
@@ -1517,8 +1517,8 @@ _outNode(StringInfo str, void *obj)
            case T_IndexScan:
                _outIndexScan(str, obj);
                break;
-           case T_Temp:
-               _outTemp(str, obj);
+           case T_Noname:
+               _outNoname(str, obj);
                break;
            case T_Sort:
                _outSort(str, obj);
index 3acf895e7c3c67a636b0060793b64667ac11cda4..175b4a5fdf46b11e3b2a46d6683d99e51c1df7aa 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/backend/nodes/print.c,v 1.19 1999/01/27 00:36:28 tgl Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/nodes/print.c,v 1.20 1999/02/09 17:02:49 momjian Exp $
  *
  * HISTORY
  *   AUTHOR            DATE            MAJOR EVENT
@@ -313,8 +313,8 @@ plannode_type(Plan *p)
        case T_HashJoin:
            return "HASHJOIN";
            break;
-       case T_Temp:
-           return "TEMP";
+       case T_Noname:
+           return "NONAME";
            break;
        case T_Material:
            return "MATERIAL";
index caebc29b1d7b382310920fa6e99a0ea66366e2f1..02e7547ab1dbdf617ac19705b29dbf654faed01d 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.51 1999/02/09 03:51:13 momjian Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.52 1999/02/09 17:02:50 momjian Exp $
  *
  * NOTES
  *   Most of the read functions for plan nodes are tested. (In fact, they
@@ -565,25 +565,25 @@ _readIndexScan()
 }
 
 /* ----------------
- *     _readTemp
+ *     _readNoname
  *
- * Temp is a subclass of Plan
+ * Noname is a subclass of Plan
  * ----------------
  */
-static Temp *
-_readTemp()
+static Noname *
+_readNoname()
 {
-   Temp       *local_node;
+   Noname     *local_node;
    char       *token;
    int         length;
 
-   local_node = makeNode(Temp);
+   local_node = makeNode(Noname);
 
    _getPlan((Plan *) local_node);
 
-   token = lsptok(NULL, &length);      /* eat :tempid */
-   token = lsptok(NULL, &length);      /* get tempid */
-   local_node->tempid = atol(token);
+   token = lsptok(NULL, &length);      /* eat :nonameid */
+   token = lsptok(NULL, &length);      /* get nonameid */
+   local_node->nonameid = atol(token);
 
    token = lsptok(NULL, &length);      /* eat :keycount */
    token = lsptok(NULL, &length);      /* get keycount */
@@ -595,7 +595,7 @@ _readTemp()
 /* ----------------
  *     _readSort
  *
- * Sort is a subclass of Temp
+ * Sort is a subclass of Noname
  * ----------------
  */
 static Sort *
@@ -609,9 +609,9 @@ _readSort()
 
    _getPlan((Plan *) local_node);
 
-   token = lsptok(NULL, &length);      /* eat :tempid */
-   token = lsptok(NULL, &length);      /* get tempid */
-   local_node->tempid = atol(token);
+   token = lsptok(NULL, &length);      /* eat :nonameid */
+   token = lsptok(NULL, &length);      /* get nonameid */
+   local_node->nonameid = atol(token);
 
    token = lsptok(NULL, &length);      /* eat :keycount */
    token = lsptok(NULL, &length);      /* get keycount */
@@ -639,7 +639,7 @@ _readAgg()
 /* ----------------
  *     _readUnique
  *
- * For some reason, unique is a subclass of Temp.
+ * For some reason, unique is a subclass of Noname.
  */
 static Unique *
 _readUnique()
@@ -652,9 +652,9 @@ _readUnique()
 
    _getPlan((Plan *) local_node);
 
-   token = lsptok(NULL, &length);      /* eat :tempid */
-   token = lsptok(NULL, &length);      /* get :tempid */
-   local_node->tempid = atol(token);
+   token = lsptok(NULL, &length);      /* eat :nonameid */
+   token = lsptok(NULL, &length);      /* get :nonameid */
+   local_node->nonameid = atol(token);
 
    token = lsptok(NULL, &length);      /* eat :keycount */
    token = lsptok(NULL, &length);      /* get :keycount */
@@ -666,7 +666,7 @@ _readUnique()
 /* ----------------
  *     _readHash
  *
- * Hash is a subclass of Temp
+ * Hash is a subclass of Noname
  * ----------------
  */
 static Hash *
@@ -2070,8 +2070,8 @@ parsePlanString(void)
        return_value = _readSeqScan();
    else if (!strncmp(token, "INDEXSCAN", length))
        return_value = _readIndexScan();
-   else if (!strncmp(token, "TEMP", length))
-       return_value = _readTemp();
+   else if (!strncmp(token, "NONAME", length))
+       return_value = _readNoname();
    else if (!strncmp(token, "SORT", length))
        return_value = _readSort();
    else if (!strncmp(token, "AGGREG", length))
index fd4ef5c9b2bc4e22e2b09bfc7f945b23622c0583..684a20d4ea24b1a6d5305f94070e8d64a191cbd5 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/backend/optimizer/path/costsize.c,v 1.26 1999/02/03 20:15:32 momjian Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/optimizer/path/costsize.c,v 1.27 1999/02/09 17:02:52 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -87,7 +87,7 @@ cost_seqscan(int relid, int relpages, int reltuples)
        /*
         * cost of sequentially scanning a materialized temporary relation
         */
-       temp += _TEMP_SCAN_COST_;
+       temp += _NONAME_SCAN_COST_;
    }
    else
    {
@@ -198,7 +198,7 @@ cost_sort(List *keys, int tuples, int width, bool noread)
        numTuples * base_log((double) pages, (double) 2.0);
 
    if (!noread)
-       temp = temp + cost_seqscan(_TEMP_RELATION_ID_, npages, tuples);
+       temp = temp + cost_seqscan(_NONAME_RELATION_ID_, npages, tuples);
    Assert(temp >= 0);
 
    return temp;
index 8dc1ecb1771c79a26d62f45c716778d5bb287e26..411ab2cbb5e5943b78971b4e6687daf8ced0186c 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/joinutils.c,v 1.12 1999/02/09 03:51:20 momjian Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/joinutils.c,v 1.13 1999/02/09 17:02:55 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -325,8 +325,7 @@ new_join_pathkeys(List *outer_pathkeys,
    foreach(i, outer_pathkeys)
    {
        outer_pathkey = lfirst(i);
-       x = new_join_pathkey(outer_pathkey, NIL,
-                            join_rel_tlist, joinclauses);
+       x = new_join_pathkey(outer_pathkey, NIL, join_rel_tlist, joinclauses);
        if (x != NIL)
            t_list = lappend(t_list, x);
    }
@@ -421,8 +420,9 @@ new_matching_subkeys(Var *subkey,
    foreach(i, joinclauses)
    {
        joinclause = lfirst(i);
-       tlist_other_var = matching_tlvar(other_join_clause_var(subkey, joinclause),
-                          join_rel_tlist);
+       tlist_other_var = matching_tlvar(
+                                   other_join_clause_var(subkey, joinclause),
+                                   join_rel_tlist);
 
        if (tlist_other_var &&
            !(member(tlist_other_var, considered_subkeys)))
index 8df92e7edd85a8a4e5a65ade782c087ac9a4f2b8..69b7ead092b2e22dff4ee7e60622d0ca91eb4117 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.39 1999/02/09 03:51:21 momjian Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.40 1999/02/09 17:02:55 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -40,8 +40,8 @@
 #include "optimizer/internal.h"
 
 
-#define TEMP_SORT      1
-#define TEMP_MATERIAL  2
+#define NONAME_SORT        1
+#define NONAME_MATERIAL    2
 
 static List *switch_outer(List *clauses);
 static Scan *create_scan_node(Path *best_path, List *tlist);
@@ -60,8 +60,8 @@ static HashJoin *create_hashjoin_node(HashPath *best_path, List *tlist,
                     List *clauses, Plan *outer_node, List *outer_tlist,
                     Plan *inner_node, List *inner_tlist);
 static Node *fix_indxqual_references(Node *clause, Path *index_path);
-static Temp *make_temp(List *tlist, List *keys, Oid *operators,
-         Plan *plan_node, int temptype);
+static Noname *make_noname(List *tlist, List *keys, Oid *operators,
+         Plan *plan_node, int nonametype);
 static IndexScan *make_indexscan(List *qptlist, List *qpqual, Index scanrelid,
               List *indxid, List *indxqual, List *indxqualorig, Cost cost);
 static NestLoop *make_nestloop(List *qptlist, List *qpqual, Plan *lefttree,
@@ -72,7 +72,7 @@ static Hash *make_hash(List *tlist, Var *hashkey, Plan *lefttree);
 static MergeJoin *make_mergejoin(List *tlist, List *qpqual,
               List *mergeclauses, Oid opcode, Oid *rightorder,
               Oid *leftorder, Plan *righttree, Plan *lefttree);
-static Material *make_material(List *tlist, Oid tempid, Plan *lefttree,
+static Material *make_material(List *tlist, Oid nonameid, Plan *lefttree,
              int keycount);
 
 /*
@@ -476,11 +476,11 @@ create_nestloop_node(JoinPath *best_path,
    }
    else if (IsA_Join(inner_node))
    {
-       inner_node = (Plan *) make_temp(inner_tlist,
+       inner_node = (Plan *) make_noname(inner_tlist,
                                        NIL,
                                        NULL,
                                        inner_node,
-                                       TEMP_MATERIAL);
+                                       NONAME_MATERIAL);
    }
 
    join_node = make_nestloop(tlist,
@@ -545,11 +545,11 @@ create_mergejoin_node(MergePath *best_path,
     */
    if (best_path->outersortkeys)
    {
-       Temp       *sorted_outer_node = make_temp(outer_tlist,
+       Noname     *sorted_outer_node = make_noname(outer_tlist,
                                                best_path->outersortkeys,
                                                  outer_order,
                                                  outer_node,
-                                                 TEMP_SORT);
+                                                 NONAME_SORT);
 
        sorted_outer_node->plan.cost = outer_node->cost;
        outer_node = (Plan *) sorted_outer_node;
@@ -557,11 +557,11 @@ create_mergejoin_node(MergePath *best_path,
 
    if (best_path->innersortkeys)
    {
-       Temp       *sorted_inner_node = make_temp(inner_tlist,
+       Noname     *sorted_inner_node = make_noname(inner_tlist,
                                                best_path->innersortkeys,
                                                  inner_order,
                                                  inner_node,
-                                                 TEMP_SORT);
+                                                 NONAME_SORT);
 
        sorted_inner_node->plan.cost = outer_node->cost;
        inner_node = (Plan *) sorted_inner_node;
@@ -798,7 +798,7 @@ switch_outer(List *clauses)
 }
 
 /*
- * set-temp-tlist-operators--
+ * set-noname-tlist-operators--
  *   Sets the key and keyop fields of resdom nodes in a target list.
  *
  *   'tlist' is the target list
@@ -812,7 +812,7 @@ switch_outer(List *clauses)
  *   Returns the modified target list.
  */
 static List *
-set_temp_tlist_operators(List *tlist, List *pathkeys, Oid *operators)
+set_noname_tlist_operators(List *tlist, List *pathkeys, Oid *operators)
 {
    Node       *keys = NULL;
    int         keyno = 1;
@@ -846,8 +846,8 @@ set_temp_tlist_operators(List *tlist, List *pathkeys, Oid *operators)
  *****************************************************************************/
 
 /*
- * make_temp--
- *   Create plan nodes to sort or materialize relations into temporaries. The
+ * make_noname--
+ *   Create plan nodes to sort or materialize relations into noname. The
  *   result returned for a sort will look like (SEQSCAN(SORT(plan-node)))
  *   or (SEQSCAN(MATERIAL(plan-node)))
  *
@@ -856,46 +856,46 @@ set_temp_tlist_operators(List *tlist, List *pathkeys, Oid *operators)
  *   'operators' is the operators with which the sort or hash is to be done
  *     (a list of operator OIDs)
  *   'plan-node' is the node which yields tuples for the sort
- *   'temptype' indicates which operation(sort or hash) to perform
+ *   'nonametype' indicates which operation(sort or hash) to perform
  */
-static Temp *
-make_temp(List *tlist,
+static Noname *
+make_noname(List *tlist,
          List *keys,
          Oid *operators,
          Plan *plan_node,
-         int temptype)
+         int nonametype)
 {
-   List       *temp_tlist;
-   Temp       *retval = NULL;
+   List       *noname_tlist;
+   Noname     *retval = NULL;
 
-   /* Create a new target list for the temporary, with keys set. */
-   temp_tlist = set_temp_tlist_operators(new_unsorted_tlist(tlist),
+   /* Create a new target list for the noname, with keys set. */
+   noname_tlist = set_noname_tlist_operators(new_unsorted_tlist(tlist),
                                          keys,
                                          operators);
-   switch (temptype)
+   switch (nonametype)
    {
-       case TEMP_SORT:
-           retval = (Temp *) make_seqscan(tlist,
+       case NONAME_SORT:
+           retval = (Noname *) make_seqscan(tlist,
                                           NIL,
-                                          _TEMP_RELATION_ID_,
-                                          (Plan *) make_sort(temp_tlist,
-                                                     _TEMP_RELATION_ID_,
+                                          _NONAME_RELATION_ID_,
+                                          (Plan *) make_sort(noname_tlist,
+                                                     _NONAME_RELATION_ID_,
                                                              plan_node,
                                                          length(keys)));
            break;
 
-       case TEMP_MATERIAL:
-           retval = (Temp *) make_seqscan(tlist,
+       case NONAME_MATERIAL:
+           retval = (Noname *) make_seqscan(tlist,
                                           NIL,
-                                          _TEMP_RELATION_ID_,
-                                      (Plan *) make_material(temp_tlist,
-                                                     _TEMP_RELATION_ID_,
+                                          _NONAME_RELATION_ID_,
+                                      (Plan *) make_material(noname_tlist,
+                                                     _NONAME_RELATION_ID_,
                                                              plan_node,
                                                          length(keys)));
            break;
 
        default:
-           elog(ERROR, "make_temp: unknown temp type %d", temptype);
+           elog(ERROR, "make_noname: unknown noname type %d", nonametype);
 
    }
    return retval;
@@ -1049,7 +1049,7 @@ make_mergejoin(List *tlist,
 }
 
 Sort *
-make_sort(List *tlist, Oid tempid, Plan *lefttree, int keycount)
+make_sort(List *tlist, Oid nonameid, Plan *lefttree, int keycount)
 {
    Sort       *node = makeNode(Sort);
    Plan       *plan = &node->plan;
@@ -1060,7 +1060,7 @@ make_sort(List *tlist, Oid tempid, Plan *lefttree, int keycount)
    plan->qual = NIL;
    plan->lefttree = lefttree;
    plan->righttree = NULL;
-   node->tempid = tempid;
+   node->nonameid = nonameid;
    node->keycount = keycount;
 
    return node;
@@ -1068,7 +1068,7 @@ make_sort(List *tlist, Oid tempid, Plan *lefttree, int keycount)
 
 static Material *
 make_material(List *tlist,
-             Oid tempid,
+             Oid nonameid,
              Plan *lefttree,
              int keycount)
 {
@@ -1081,7 +1081,7 @@ make_material(List *tlist,
    plan->qual = NIL;
    plan->lefttree = lefttree;
    plan->righttree = NULL;
-   node->tempid = tempid;
+   node->nonameid = nonameid;
    node->keycount = keycount;
 
    return node;
@@ -1145,7 +1145,7 @@ make_unique(List *tlist, Plan *lefttree, char *uniqueAttr)
    plan->qual = NIL;
    plan->lefttree = lefttree;
    plan->righttree = NULL;
-   node->tempid = _TEMP_RELATION_ID_;
+   node->nonameid = _NONAME_RELATION_ID_;
    node->keycount = 0;
    if (strcmp(uniqueAttr, "*") == 0)
        node->uniqueAttr = NULL;
index f9e52260bfa4c1f15cc63925e9625b3e0df50092..f724f39325b47f7b0c751b6ac56da3fee4a3b80b 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planmain.c,v 1.29 1998/10/01 02:03:59 tgl Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planmain.c,v 1.30 1999/02/09 17:03:00 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -478,7 +478,7 @@ make_groupPlan(List **tlist,
    }
 
    sortplan = make_sort(sort_tlist,
-                        _TEMP_RELATION_ID_,
+                        _NONAME_RELATION_ID_,
                         subplan,
                         numCols);
    sortplan->plan.cost = subplan->cost;        /* XXX assume no cost */
index 07abe77c580983c5973cc4319079529e579e055b..c460bbdb9714c27be473c09c66262a988e8216de 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.42 1999/02/03 21:16:36 momjian Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.43 1999/02/09 17:03:01 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -399,7 +399,7 @@ make_sortplan(List *tlist, List *sortcls, Plan *plannode)
    }
 
    sortplan = (Plan *) make_sort(temp_tlist,
-                                 _TEMP_RELATION_ID_,
+                                 _NONAME_RELATION_ID_,
                                  (Plan *) plannode,
                                  length(sortcls));
 
index 63ec89ba72cc5bc0e14bce5b91a631daba780ef8..d8b1046fa075040cc32d3d1617b9aaf16ca340c9 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/backend/optimizer/plan/setrefs.c,v 1.37 1999/02/03 21:16:38 momjian Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/optimizer/plan/setrefs.c,v 1.38 1999/02/09 17:03:01 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
 #include "optimizer/tlist.h"
 
 static void set_join_tlist_references(Join *join);
-static void set_tempscan_tlist_references(SeqScan *tempscan);
-static void set_temp_tlist_references(Temp *temp);
+static void set_nonamescan_tlist_references(SeqScan *nonamescan);
+static void set_noname_tlist_references(Noname *noname);
 static List *replace_clause_joinvar_refs(Expr *clause,
                            List *outer_tlist, List *inner_tlist);
 static List *replace_subclause_joinvar_refs(List *clauses,
                               List *outer_tlist, List *inner_tlist);
 static Var *replace_joinvar_refs(Var *var, List *outer_tlist, List *inner_tlist);
-static List *tlist_temp_references(Oid tempid, List *tlist);
+static List *tlist_noname_references(Oid nonameid, List *tlist);
 static void replace_result_clause(Node *clause, List *subplanTargetList);
 static bool OperandIsInner(Node *opnd, int inner_relid);
 static List *replace_agg_clause(Node *expr, List *targetlist);
@@ -74,10 +74,10 @@ set_tlist_references(Plan *plan)
    if (IsA_Join(plan))
        set_join_tlist_references((Join *) plan);
    else if (IsA(plan, SeqScan) &&plan->lefttree &&
-            IsA_Temp(plan->lefttree))
-       set_tempscan_tlist_references((SeqScan *) plan);
+            IsA_Noname(plan->lefttree))
+       set_nonamescan_tlist_references((SeqScan *) plan);
    else if (IsA(plan, Sort))
-       set_temp_tlist_references((Temp *) plan);
+       set_noname_tlist_references((Noname *) plan);
    else if (IsA(plan, Result))
        set_result_tlist_references((Result *) plan);
    else if (IsA(plan, Hash))
@@ -136,49 +136,49 @@ set_join_tlist_references(Join *join)
 }
 
 /*
- * set-tempscan-tlist-references--
- *   Modifies the target list of a node that scans a temp relation (i.e., a
- *   sort or hash node) so that the varnos refer to the child temporary.
+ * set-nonamescan-tlist-references--
+ *   Modifies the target list of a node that scans a noname relation (i.e., a
+ *   sort or hash node) so that the varnos refer to the child noname.
  *
- * 'tempscan' is a seqscan node
+ * 'nonamescan' is a seqscan node
  *
  * Returns nothing of interest, but modifies internal fields of nodes.
  *
  */
 static void
-set_tempscan_tlist_references(SeqScan *tempscan)
+set_nonamescan_tlist_references(SeqScan *nonamescan)
 {
-   Temp       *temp = (Temp *) ((Plan *) tempscan)->lefttree;
+   Noname     *noname = (Noname *) ((Plan *) nonamescan)->lefttree;
 
-   ((Plan *) tempscan)->targetlist = tlist_temp_references(temp->tempid,
-                             ((Plan *) tempscan)->targetlist);
-   set_temp_tlist_references(temp);
+   ((Plan *) nonamescan)->targetlist = tlist_noname_references(noname->nonameid,
+                             ((Plan *) nonamescan)->targetlist);
+   set_noname_tlist_references(noname);
 }
 
 /*
- * set-temp-tlist-references--
- *   The temp's vars are made consistent with (actually, identical to) the
- *   modified version of the target list of the node from which temp node
+ * set-noname-tlist-references--
+ *   The noname's vars are made consistent with (actually, identical to) the
+ *   modified version of the target list of the node from which noname node
  *   receives its tuples.
  *
- * 'temp' is a temp (e.g., sort, hash) plan node
+ * 'noname' is a noname (e.g., sort, hash) plan node
  *
  * Returns nothing of interest, but modifies internal fields of nodes.
  *
  */
 static void
-set_temp_tlist_references(Temp *temp)
+set_noname_tlist_references(Noname *noname)
 {
-   Plan       *source = ((Plan *) temp)->lefttree;
+   Plan       *source = ((Plan *) noname)->lefttree;
 
    if (source != NULL)
    {
        set_tlist_references(source);
-       ((Plan *) temp)->targetlist = copy_vars(((Plan *) temp)->targetlist,
+       ((Plan *) noname)->targetlist = copy_vars(((Plan *) noname)->targetlist,
                      (source)->targetlist);
    }
    else
-       elog(ERROR, "calling set_temp_tlist_references with empty lefttree");
+       elog(ERROR, "calling set_noname_tlist_references with empty lefttree");
 }
 
 /*
@@ -475,25 +475,25 @@ replace_joinvar_refs(Var *var, List *outer_tlist, List *inner_tlist)
 }
 
 /*
- * tlist-temp-references--
- *   Creates a new target list for a node that scans a temp relation,
- *   setting the varnos to the id of the temp relation and setting varids
+ * tlist-noname-references--
+ *   Creates a new target list for a node that scans a noname relation,
+ *   setting the varnos to the id of the noname relation and setting varids
  *   if necessary (varids are only needed if this is a targetlist internal
  *   to the tree, in which case the targetlist entry always contains a var
- *   node, so we can just copy it from the temp).
+ *   node, so we can just copy it from the noname).
  *
- * 'tempid' is the id of the temp relation
+ * 'nonameid' is the id of the noname relation
  * 'tlist' is the target list to be modified
  *
  * Returns new target list
  *
  */
 static List *
-tlist_temp_references(Oid tempid,
+tlist_noname_references(Oid nonameid,
                      List *tlist)
 {
    List       *t_list = NIL;
-   TargetEntry *temp = (TargetEntry *) NULL;
+   TargetEntry *noname = (TargetEntry *) NULL;
    TargetEntry *xtl = NULL;
    List       *entry;
 
@@ -507,16 +507,16 @@ tlist_temp_references(Oid tempid,
        else
            oattno = 0;
 
-       temp = makeTargetEntry(xtl->resdom,
-                              (Node *) makeVar(tempid,
+       noname = makeTargetEntry(xtl->resdom,
+                              (Node *) makeVar(nonameid,
                                                xtl->resdom->resno,
                                                xtl->resdom->restype,
                                                xtl->resdom->restypmod,
                                                0,
-                                               tempid,
+                                               nonameid,
                                                oattno));
 
-       t_list = lappend(t_list, temp);
+       t_list = lappend(t_list, noname);
    }
    return t_list;
 }
index 0f1d36b6382d335a7ad6f5482043b40997ba7c92..9706f654ebf1d065b541cd2dafcfef34b4823b5e 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/backend/optimizer/util/relnode.c,v 1.10 1999/02/03 20:15:43 momjian Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/optimizer/util/relnode.c,v 1.11 1999/02/09 17:03:01 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -70,8 +70,8 @@ get_base_rel(Query *root, int relid)
             * If the relation is a materialized relation, assume
             * constants for sizes.
             */
-           rel->pages = _TEMP_RELATION_PAGES_;
-           rel->tuples = _TEMP_RELATION_TUPLES_;
+           rel->pages = _NONAME_RELATION_PAGES_;
+           rel->tuples = _NONAME_RELATION_TUPLES_;
 
        }
        else
index 4ce89d0e4e85fba05314dbd197d82590fce45c6b..5a8b9dbfc9f4925c8120b5f831d890b09e971e1f 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: nodes.h,v 1.40 1999/02/09 03:51:41 momjian Exp $
+ * $Id: nodes.h,v 1.41 1999/02/09 17:03:11 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -38,7 +38,7 @@ typedef enum NodeTag
    T_NestLoop,
    T_MergeJoin,
    T_HashJoin,
-   T_Temp,
+   T_Noname,
    T_Material,
    T_Sort,
    T_Agg,
@@ -251,8 +251,8 @@ typedef struct Node
    (nodeTag(j)==T_Join || nodeTag(j)==T_NestLoop || \
     nodeTag(j)==T_MergeJoin || nodeTag(j)==T_HashJoin)
 
-#define IsA_Temp(t) \
-   (nodeTag(t)==T_Temp || nodeTag(t)==T_Material || nodeTag(t)==T_Sort || \
+#define IsA_Noname(t) \
+   (nodeTag(t)==T_Noname || nodeTag(t)==T_Material || nodeTag(t)==T_Sort || \
     nodeTag(t)==T_Unique)
 
 /* ----------------------------------------------------------------
index d652a48f6bf86b370fe21e8f7d608989434a3caa..a54b8e0a96c14ec9916e5691d6274b0528bc6518 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: plannodes.h,v 1.20 1999/01/23 23:28:09 momjian Exp $
+ * $Id: plannodes.h,v 1.21 1999/02/09 17:03:12 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -262,15 +262,15 @@ typedef struct Group
 
 /*
  * ==========
- * Temp nodes
+ * Noname nodes
  * ==========
  */
-typedef struct Temp
+typedef struct Noname
 {
    Plan        plan;
-   Oid         tempid;
+   Oid         nonameid;
    int         keycount;
-} Temp;
+} Noname;
 
 /* ----------------
  *     materialization node
@@ -278,8 +278,8 @@ typedef struct Temp
  */
 typedef struct Material
 {
-   Plan        plan;           /* temp node flattened out */
-   Oid         tempid;
+   Plan        plan;           /* noname node flattened out */
+   Oid         nonameid;
    int         keycount;
    MaterialState *matstate;
 } Material;
@@ -290,8 +290,8 @@ typedef struct Material
  */
 typedef struct Sort
 {
-   Plan        plan;           /* temp node flattened out */
-   Oid         tempid;
+   Plan        plan;           /* noname node flattened out */
+   Oid         nonameid;
    int         keycount;
    SortState  *sortstate;
    void       *psortstate;
@@ -304,8 +304,8 @@ typedef struct Sort
  */
 typedef struct Unique
 {
-   Plan        plan;           /* temp node flattened out */
-   Oid         tempid;
+   Plan        plan;           /* noname node flattened out */
+   Oid         nonameid;
    int         keycount;
    char       *uniqueAttr;     /* NULL if all attrs, or unique attribute
                                 * name */
index 76327c03270c65035a239c2d75bfd22dbe7075ac..5d8e75d146df524d95c359f3871c262ef72a5420 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: internal.h,v 1.12 1999/02/02 03:45:24 momjian Exp $
+ * $Id: internal.h,v 1.13 1999/02/09 17:03:14 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
 
 /*    The cost of sequentially scanning a materialized temporary relation
  */
-#define _TEMP_SCAN_COST_       10
+#define _NONAME_SCAN_COST_     10
 
 /*    The number of pages and tuples in a materialized relation
  */
-#define _TEMP_RELATION_PAGES_          1
-#define _TEMP_RELATION_TUPLES_ 10
+#define _NONAME_RELATION_PAGES_            1
+#define _NONAME_RELATION_TUPLES_   10
 
 /*    The length of a variable-length field in bytes
  */
@@ -59,7 +59,7 @@
 
 /*    Identifier for (sort) temp relations   */
 /* used to be -1 */
-#define _TEMP_RELATION_ID_  InvalidOid
+#define _NONAME_RELATION_ID_    InvalidOid
 
 /*    Identifier for invalid relation OIDs and attribute numbers for use by
  *    selectivity functions
index 82024732f1c22573e8c7e6c85a6aa907c8a00a9e..1bb2b636aa7d065d6841bee4eacea13f6d02f0d0 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: planmain.h,v 1.19 1999/02/02 17:46:16 momjian Exp $
+ * $Id: planmain.h,v 1.20 1999/02/09 17:03:14 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -31,7 +31,7 @@ extern Plan *query_planner(Query *root,
 extern Plan *create_plan(Path *best_path);
 extern SeqScan *make_seqscan(List *qptlist, List *qpqual, Index scanrelid,
             Plan *lefttree);
-extern Sort *make_sort(List *tlist, Oid tempid, Plan *lefttree,
+extern Sort *make_sort(List *tlist, Oid nonameid, Plan *lefttree,
          int keycount);
 extern Agg *make_agg(List *tlist, Plan *lefttree);
 extern Group *make_group(List *tlist, bool tuplePerGroup, int ngrp,