Skip to content

Commit 6f9ff92

Browse files
committed
Tid access method feature from Hiroshi Inoue, Inoue@tpf.co.jp
1 parent 54ffd46 commit 6f9ff92

28 files changed

+1396
-32
lines changed

src/backend/access/heap/heapam.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.58 1999/11/07 23:07:52 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.59 1999/11/23 20:06:47 momjian Exp $
1111
*
1212
*
1313
* INTERFACE ROUTINES
@@ -1062,7 +1062,13 @@ heap_fetch(Relation relation,
10621062
* ----------------
10631063
*/
10641064

1065-
Assert(ItemIdIsUsed(lp));
1065+
if (!ItemIdIsUsed(lp))
1066+
{
1067+
ReleaseBuffer(buffer);
1068+
*userbuf = InvalidBuffer;
1069+
tuple->t_data = NULL;
1070+
return;
1071+
}
10661072

10671073
tuple->t_data = (HeapTupleHeader) PageGetItem((Page) dp, lp);
10681074
tuple->t_len = ItemIdGetLength(lp);

src/backend/commands/explain.c

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Copyright (c) 1994-5, Regents of the University of California
66
*
7-
* $Id: explain.c,v 1.49 1999/11/07 23:08:02 momjian Exp $
7+
* $Id: explain.c,v 1.50 1999/11/23 20:06:48 momjian Exp $
88
*
99
*/
1010

@@ -196,6 +196,9 @@ explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es)
196196
case T_Hash:
197197
pname = "Hash";
198198
break;
199+
case T_TidScan:
200+
pname = "Tid Scan";
201+
break;
199202
default:
200203
pname = "???";
201204
break;
@@ -234,6 +237,20 @@ explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es)
234237
appendStringInfo(str, stringStringInfo(rte->refname));
235238
}
236239
break;
240+
case T_TidScan:
241+
if (((TidScan *) plan)->scan.scanrelid > 0)
242+
{
243+
RangeTblEntry *rte = nth(((TidScan *) plan)->scan.scanrelid - 1, es->rtable);
244+
245+
appendStringInfo(str, " on ");
246+
if (strcmp(rte->refname, rte->relname) != 0)
247+
{
248+
appendStringInfo(str, "%s ",
249+
stringStringInfo(rte->relname));
250+
}
251+
appendStringInfo(str, stringStringInfo(rte->refname));
252+
}
253+
break;
237254
default:
238255
break;
239256
}

src/backend/executor/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Makefile for executor
55
#
66
# IDENTIFICATION
7-
# $Header: /cvsroot/pgsql/src/backend/executor/Makefile,v 1.8 1999/03/23 16:50:46 momjian Exp $
7+
# $Header: /cvsroot/pgsql/src/backend/executor/Makefile,v 1.9 1999/11/23 20:06:49 momjian Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -18,7 +18,8 @@ OBJS = execAmi.o execFlatten.o execJunk.o execMain.o \
1818
execUtils.o functions.o nodeAppend.o nodeAgg.o nodeHash.o \
1919
nodeHashjoin.o nodeIndexscan.o nodeMaterial.o nodeMergejoin.o \
2020
nodeNestloop.o nodeResult.o nodeSeqscan.o nodeSort.o \
21-
nodeUnique.o nodeGroup.o spi.o nodeSubplan.o
21+
nodeUnique.o nodeGroup.o spi.o nodeSubplan.o \
22+
nodeTidscan.o
2223

2324
all: SUBSYS.o
2425

src/backend/executor/execAmi.c

Lines changed: 15 additions & 2 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: execAmi.c,v 1.43 1999/11/04 08:00:57 inoue Exp $
8+
* $Id: execAmi.c,v 1.44 1999/11/23 20:06:50 momjian Exp $
99
*
1010
*-------------------------------------------------------------------------
1111
*/
@@ -40,6 +40,7 @@
4040
#include "executor/nodeHash.h"
4141
#include "executor/nodeHashjoin.h"
4242
#include "executor/nodeIndexscan.h"
43+
#include "executor/nodeTidscan.h"
4344
#include "executor/nodeMaterial.h"
4445
#include "executor/nodeMergejoin.h"
4546
#include "executor/nodeNestloop.h"
@@ -217,6 +218,10 @@ ExecCloseR(Plan *node)
217218
state = &(((Agg *) node)->aggstate->csstate);
218219
break;
219220

221+
case T_TidScan:
222+
state = ((TidScan *) node)->scan.scanstate;
223+
break;
224+
220225
default:
221226
elog(DEBUG, "ExecCloseR: not a scan, material, or sort node!");
222227
return;
@@ -367,6 +372,10 @@ ExecReScan(Plan *node, ExprContext *exprCtxt, Plan *parent)
367372
ExecReScanAppend((Append *) node, exprCtxt, parent);
368373
break;
369374

375+
case T_TidScan:
376+
ExecTidReScan((TidScan *) node, exprCtxt, parent);
377+
break;
378+
370379
default:
371380
elog(ERROR, "ExecReScan: node type %u not supported", nodeTag(node));
372381
return;
@@ -413,7 +422,7 @@ ExecMarkPos(Plan *node)
413422
{
414423
switch (nodeTag(node))
415424
{
416-
case T_SeqScan:
425+
case T_SeqScan:
417426
ExecSeqMarkPos((SeqScan *) node);
418427
break;
419428

@@ -425,6 +434,10 @@ ExecMarkPos(Plan *node)
425434
ExecSortMarkPos((Sort *) node);
426435
break;
427436

437+
case T_TidScan:
438+
ExecTidMarkPos((TidScan *) node);
439+
break;
440+
428441
default:
429442
elog(DEBUG, "ExecMarkPos: node type %u not supported", nodeTag(node));
430443
break;

src/backend/executor/execProcnode.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*
1313
* IDENTIFICATION
14-
* $Header: /cvsroot/pgsql/src/backend/executor/execProcnode.c,v 1.15 1999/07/16 04:58:46 momjian Exp $
14+
* $Header: /cvsroot/pgsql/src/backend/executor/execProcnode.c,v 1.16 1999/11/23 20:06:51 momjian Exp $
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
@@ -81,6 +81,7 @@
8181
#include "executor/nodeHash.h"
8282
#include "executor/nodeHashjoin.h"
8383
#include "executor/nodeIndexscan.h"
84+
#include "executor/nodeTidscan.h"
8485
#include "executor/nodeMaterial.h"
8586
#include "executor/nodeMergejoin.h"
8687
#include "executor/nodeNestloop.h"
@@ -195,6 +196,10 @@ ExecInitNode(Plan *node, EState *estate, Plan *parent)
195196
result = ExecInitHashJoin((HashJoin *) node, estate, parent);
196197
break;
197198

199+
case T_TidScan:
200+
result = ExecInitTidScan((TidScan *) node, estate, parent);
201+
break;
202+
198203
default:
199204
elog(ERROR, "ExecInitNode: node %d unsupported", nodeTag(node));
200205
result = FALSE;
@@ -310,6 +315,10 @@ ExecProcNode(Plan *node, Plan *parent)
310315
result = ExecHashJoin((HashJoin *) node);
311316
break;
312317

318+
case T_TidScan:
319+
result = ExecTidScan((TidScan *) node);
320+
break;
321+
313322
default:
314323
elog(ERROR, "ExecProcNode: node %d unsupported", nodeTag(node));
315324
result = NULL;
@@ -381,6 +390,9 @@ ExecCountSlotsNode(Plan *node)
381390
case T_HashJoin:
382391
return ExecCountSlotsHashJoin((HashJoin *) node);
383392

393+
case T_TidScan:
394+
return ExecCountSlotsTidScan((TidScan *) node);
395+
384396
default:
385397
elog(ERROR, "ExecCountSlotsNode: node not yet supported: %d",
386398
nodeTag(node));
@@ -497,6 +509,10 @@ ExecEndNode(Plan *node, Plan *parent)
497509
ExecEndHashJoin((HashJoin *) node);
498510
break;
499511

512+
case T_TidScan:
513+
ExecEndTidScan((TidScan *) node);
514+
break;
515+
500516
default:
501517
elog(ERROR, "ExecEndNode: node %d unsupported", nodeTag(node));
502518
break;

src/backend/executor/execTuples.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*
1515
*
1616
* IDENTIFICATION
17-
* $Header: /cvsroot/pgsql/src/backend/executor/execTuples.c,v 1.31 1999/11/07 23:08:06 momjian Exp $
17+
* $Header: /cvsroot/pgsql/src/backend/executor/execTuples.c,v 1.32 1999/11/23 20:06:51 momjian Exp $
1818
*
1919
*-------------------------------------------------------------------------
2020
*/
@@ -771,6 +771,13 @@ NodeGetResultTupleSlot(Plan *node)
771771
}
772772
break;
773773

774+
case T_TidScan:
775+
{
776+
CommonScanState *scanstate = ((IndexScan *) node)->scan.scanstate;
777+
slot = scanstate->cstate.cs_ResultTupleSlot;
778+
}
779+
break;
780+
774781
default:
775782
/* ----------------
776783
* should never get here

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy