Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 8d9237d

Browse files
committed
Optimizer rename ClauseInfo -> RestrictInfo. Update optimizer README.
1 parent f3a6b38 commit 8d9237d

35 files changed

+450
-455
lines changed

src/backend/commands/defind.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/defind.c,v 1.31 1999/02/02 03:44:19 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/defind.c,v 1.32 1999/02/03 20:15:20 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -20,6 +20,7 @@
2020
#include <access/heapam.h>
2121
#include <utils/builtins.h>
2222
#include <utils/syscache.h>
23+
#include <catalog/heap.h>
2324
#include <catalog/index.h>
2425
#include <catalog/pg_index.h>
2526
#include <catalog/pg_proc.h>

src/backend/nodes/copyfuncs.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*-------------------------------------------------------------------------
1+
/*-------------------------------------------------------------------------
22
*
33
* copyfuncs.c--
44
* Copy functions for Postgres tree nodes.
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.57 1999/02/02 03:44:26 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.58 1999/02/03 20:15:20 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -1064,7 +1064,7 @@ _copyRelOptInfo(RelOptInfo * from)
10641064
newnode->ordering[len] = 0;
10651065
}
10661066

1067-
Node_Copy(from, newnode, clauseinfo);
1067+
Node_Copy(from, newnode, restrictinfo);
10681068
Node_Copy(from, newnode, joininfo);
10691069
Node_Copy(from, newnode, innerjoin);
10701070
Node_Copy(from, newnode, superrels);
@@ -1119,7 +1119,7 @@ CopyPathFields(Path *from, Path *newnode)
11191119
newnode->outerjoincost = from->outerjoincost;
11201120

11211121
newnode->joinid = listCopy(from->joinid);
1122-
Node_Copy(from, newnode, locclauseinfo);
1122+
Node_Copy(from, newnode, loc_restrictinfo);
11231123
}
11241124

11251125
/* ----------------
@@ -1184,7 +1184,7 @@ _copyIndexPath(IndexPath *from)
11841184
static void
11851185
CopyJoinPathFields(JoinPath *from, JoinPath *newnode)
11861186
{
1187-
Node_Copy(from, newnode, pathclauseinfo);
1187+
Node_Copy(from, newnode, pathinfo);
11881188
Node_Copy(from, newnode, outerjoinpath);
11891189
Node_Copy(from, newnode, innerjoinpath);
11901190
}
@@ -1324,13 +1324,13 @@ _copyMergeOrder(MergeOrder *from)
13241324
}
13251325

13261326
/* ----------------
1327-
* _copyClauseInfo
1327+
* _copyRestrictInfo
13281328
* ----------------
13291329
*/
1330-
static ClauseInfo *
1331-
_copyClauseInfo(ClauseInfo * from)
1330+
static RestrictInfo *
1331+
_copyRestrictInfo(RestrictInfo * from)
13321332
{
1333-
ClauseInfo *newnode = makeNode(ClauseInfo);
1333+
RestrictInfo *newnode = makeNode(RestrictInfo);
13341334

13351335
/* ----------------
13361336
* copy remainder of node
@@ -1430,7 +1430,7 @@ _copyJoinInfo(JoinInfo * from)
14301430
* ----------------
14311431
*/
14321432
newnode->otherrels = listCopy(from->otherrels);
1433-
Node_Copy(from, newnode, jinfoclauseinfo);
1433+
Node_Copy(from, newnode, jinfo_restrictinfo);
14341434

14351435
newnode->mergejoinable = from->mergejoinable;
14361436
newnode->hashjoinable = from->hashjoinable;
@@ -1792,8 +1792,8 @@ copyObject(void *from)
17921792
case T_MergeOrder:
17931793
retval = _copyMergeOrder(from);
17941794
break;
1795-
case T_ClauseInfo:
1796-
retval = _copyClauseInfo(from);
1795+
case T_RestrictInfo:
1796+
retval = _copyRestrictInfo(from);
17971797
break;
17981798
case T_JoinMethod:
17991799
retval = _copyJoinMethod(from);

src/backend/nodes/equalfuncs.c

Lines changed: 26 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.21 1999/02/02 23:53:25 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.22 1999/02/03 20:15:22 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -278,13 +278,13 @@ _equalFunc(Func *a, Func *b)
278278
}
279279

280280
/*
281-
* ClauseInfo is a subclass of Node.
281+
* RestrictInfo is a subclass of Node.
282282
*/
283283
static bool
284-
_equalClauseInfo(ClauseInfo * a, ClauseInfo * b)
284+
_equalRestrictInfo(RestrictInfo * a, RestrictInfo * b)
285285
{
286-
Assert(IsA(a, ClauseInfo));
287-
Assert(IsA(b, ClauseInfo));
286+
Assert(IsA(a, RestrictInfo));
287+
Assert(IsA(b, RestrictInfo));
288288

289289
if (!equal(a->clause, b->clause))
290290
return false;
@@ -298,8 +298,7 @@ _equalClauseInfo(ClauseInfo * a, ClauseInfo * b)
298298
#endif
299299
if (a->hashjoinoperator != b->hashjoinoperator)
300300
return false;
301-
return (equal((a->indexids),
302-
(b->indexids)));
301+
return equal(a->indexids, b->indexids);
303302
}
304303

305304
/*
@@ -311,8 +310,7 @@ _equalRelOptInfo(RelOptInfo * a, RelOptInfo * b)
311310
Assert(IsA(a, RelOptInfo));
312311
Assert(IsA(b, RelOptInfo));
313312

314-
return (equal((a->relids),
315-
(b->relids)));
313+
return equal(a->relids, b->relids);
316314
}
317315

318316
static bool
@@ -321,11 +319,9 @@ _equalJoinMethod(JoinMethod *a, JoinMethod *b)
321319
Assert(IsA(a, JoinMethod));
322320
Assert(IsA(b, JoinMethod));
323321

324-
if (!equal((a->jmkeys),
325-
(b->jmkeys)))
322+
if (!equal(a->jmkeys, b->jmkeys))
326323
return false;
327-
if (!equal((a->clauses),
328-
(b->clauses)))
324+
if (!equal(a->clauses, b->clauses))
329325
return false;
330326
return true;
331327
}
@@ -368,19 +364,16 @@ _equalPath(Path *a, Path *b)
368364
}
369365
else
370366
{
371-
if (!equal((a->p_ordering.ord.merge),
372-
(b->p_ordering.ord.merge)))
367+
if (!equal(a->p_ordering.ord.merge, b->p_ordering.ord.merge))
373368
return false;
374369
}
375-
if (!equal((a->keys),
376-
(b->keys)))
370+
if (!equal(a->keys, b->keys))
377371
return false;
378372

379373
/*
380374
* if (a->outerjoincost != b->outerjoincost) return(false);
381375
*/
382-
if (!equali((a->joinid),
383-
(b->joinid)))
376+
if (!equali(a->joinid, b->joinid))
384377
return false;
385378
return true;
386379
}
@@ -390,9 +383,9 @@ _equalIndexPath(IndexPath *a, IndexPath *b)
390383
{
391384
if (!_equalPath((Path *) a, (Path *) b))
392385
return false;
393-
if (!equali((a->indexid), (b->indexid)))
386+
if (!equali(a->indexid, b->indexid))
394387
return false;
395-
if (!equal((a->indexqual), (b->indexqual)))
388+
if (!equal(a->indexqual, b->indexqual))
396389
return false;
397390
return true;
398391
}
@@ -405,11 +398,11 @@ _equalJoinPath(JoinPath *a, JoinPath *b)
405398

406399
if (!_equalPath((Path *) a, (Path *) b))
407400
return false;
408-
if (!equal((a->pathclauseinfo), (b->pathclauseinfo)))
401+
if (!equal(a->pathinfo, b->pathinfo))
409402
return false;
410-
if (!equal((a->outerjoinpath), (b->outerjoinpath)))
403+
if (!equal(a->outerjoinpath, b->outerjoinpath))
411404
return false;
412-
if (!equal((a->innerjoinpath), (b->innerjoinpath)))
405+
if (!equal(a->innerjoinpath, b->innerjoinpath))
413406
return false;
414407
return true;
415408
}
@@ -454,9 +447,9 @@ _equalJoinKey(JoinKey *a, JoinKey *b)
454447
Assert(IsA(a, JoinKey));
455448
Assert(IsA(b, JoinKey));
456449

457-
if (!equal((a->outer), (b->outer)))
450+
if (!equal(a->outer, b->outer))
458451
return false;
459-
if (!equal((a->inner), (b->inner)))
452+
if (!equal(a->inner, b->inner))
460453
return false;
461454
return true;
462455
}
@@ -506,13 +499,13 @@ _equalIndexScan(IndexScan *a, IndexScan *b)
506499
* if(a->scan.plan.cost != b->scan.plan.cost) return(false);
507500
*/
508501

509-
if (!equal((a->indxqual), (b->indxqual)))
502+
if (!equal(a->indxqual, b->indxqual))
510503
return false;
511504

512505
if (a->scan.scanrelid != b->scan.scanrelid)
513506
return false;
514507

515-
if (!equali((a->indxid), (b->indxid)))
508+
if (!equali(a->indxid, b->indxid))
516509
return false;
517510
return true;
518511
}
@@ -523,7 +516,7 @@ _equalSubPlan(SubPlan *a, SubPlan *b)
523516
if (a->plan_id != b->plan_id)
524517
return false;
525518

526-
if (!equal((a->sublink->oper), (b->sublink->oper)))
519+
if (!equal(a->sublink->oper, b->sublink->oper))
527520
return false;
528521

529522
return true;
@@ -534,9 +527,9 @@ _equalJoinInfo(JoinInfo * a, JoinInfo * b)
534527
{
535528
Assert(IsA(a, JoinInfo));
536529
Assert(IsA(b, JoinInfo));
537-
if (!equal((a->otherrels), (b->otherrels)))
530+
if (!equal(a->otherrels, b->otherrels))
538531
return false;
539-
if (!equal((a->jinfoclauseinfo), (b->jinfoclauseinfo)))
532+
if (!equal(a->jinfo_restrictinfo, b->jinfo_restrictinfo))
540533
return false;
541534
if (a->mergejoinable != b->mergejoinable)
542535
return false;
@@ -673,8 +666,8 @@ equal(void *a, void *b)
673666
case T_Func:
674667
retval = _equalFunc(a, b);
675668
break;
676-
case T_ClauseInfo:
677-
retval = _equalClauseInfo(a, b);
669+
case T_RestrictInfo:
670+
retval = _equalRestrictInfo(a, b);
678671
break;
679672
case T_RelOptInfo:
680673
retval = _equalRelOptInfo(a, b);

src/backend/nodes/outfuncs.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Copyright (c) 1994, Regents of the University of California
77
*
8-
* $Id: outfuncs.c,v 1.62 1999/02/02 03:44:26 momjian Exp $
8+
* $Id: outfuncs.c,v 1.63 1999/02/03 20:15:22 momjian Exp $
99
*
1010
* NOTES
1111
* Every (plan) node in POSTGRES has an associated "out" routine which
@@ -879,11 +879,11 @@ _outRelOptInfo(StringInfo str, RelOptInfo * node)
879879
*/
880880

881881
appendStringInfo(str,
882-
" :unorderedpath @ 0x%x :cheapestpath @ 0x%x :pruneable %s :clauseinfo ",
882+
" :unorderedpath @ 0x%x :cheapestpath @ 0x%x :pruneable %s :restrictinfo ",
883883
(int) node->unorderedpath,
884884
(int) node->cheapestpath,
885885
node->pruneable ? "true" : "false");
886-
_outNode(str, node->clauseinfo);
886+
_outNode(str, node->restrictinfo);
887887

888888
appendStringInfo(str, " :joininfo ");
889889
_outNode(str, node->joininfo);
@@ -967,8 +967,8 @@ _outJoinPath(StringInfo str, JoinPath *node)
967967
node->path.path_cost);
968968
_outNode(str, node->path.keys);
969969

970-
appendStringInfo(str, " :pathclauseinfo ");
971-
_outNode(str, node->pathclauseinfo);
970+
appendStringInfo(str, " :pathinfo ");
971+
_outNode(str, node->pathinfo);
972972

973973
/*
974974
* Not sure if these are nodes; they're declared as "struct path *".
@@ -995,8 +995,8 @@ _outMergePath(StringInfo str, MergePath *node)
995995
node->jpath.path.path_cost);
996996
_outNode(str, node->jpath.path.keys);
997997

998-
appendStringInfo(str, " :pathclauseinfo ");
999-
_outNode(str, node->jpath.pathclauseinfo);
998+
appendStringInfo(str, " :pathinfo ");
999+
_outNode(str, node->jpath.pathinfo);
10001000

10011001
/*
10021002
* Not sure if these are nodes; they're declared as "struct path *".
@@ -1032,8 +1032,8 @@ _outHashPath(StringInfo str, HashPath *node)
10321032
node->jpath.path.path_cost);
10331033
_outNode(str, node->jpath.path.keys);
10341034

1035-
appendStringInfo(str, " :pathclauseinfo ");
1036-
_outNode(str, node->jpath.pathclauseinfo);
1035+
appendStringInfo(str, " :pathinfo ");
1036+
_outNode(str, node->jpath.pathinfo);
10371037

10381038
/*
10391039
* Not sure if these are nodes; they're declared as "struct path *".
@@ -1102,10 +1102,10 @@ _outMergeOrder(StringInfo str, MergeOrder *node)
11021102
}
11031103

11041104
/*
1105-
* ClauseInfo is a subclass of Node.
1105+
* RestrictInfo is a subclass of Node.
11061106
*/
11071107
static void
1108-
_outClauseInfo(StringInfo str, ClauseInfo * node)
1108+
_outRestrictInfo(StringInfo str, RestrictInfo * node)
11091109
{
11101110
appendStringInfo(str, " CINFO :clause ");
11111111
_outNode(str, node->clause);
@@ -1158,8 +1158,8 @@ _outJoinInfo(StringInfo str, JoinInfo * node)
11581158
appendStringInfo(str, " JINFO :otherrels ");
11591159
_outIntList(str, node->otherrels);
11601160

1161-
appendStringInfo(str, " :jinfoclauseinfo ");
1162-
_outNode(str, node->jinfoclauseinfo);
1161+
appendStringInfo(str, " :jinfo_restrictinfo ");
1162+
_outNode(str, node->jinfo_restrictinfo);
11631163

11641164
appendStringInfo(str, " :mergejoinable %s :hashjoinable %s ",
11651165
node->mergejoinable ? "true" : "false",
@@ -1572,8 +1572,8 @@ _outNode(StringInfo str, void *obj)
15721572
case T_MergeOrder:
15731573
_outMergeOrder(str, obj);
15741574
break;
1575-
case T_ClauseInfo:
1576-
_outClauseInfo(str, obj);
1575+
case T_RestrictInfo:
1576+
_outRestrictInfo(str, obj);
15771577
break;
15781578
case T_JoinMethod:
15791579
_outJoinMethod(str, obj);

0 commit comments

Comments
 (0)