Commit 439a2af0 authored by Bruce Momjian's avatar Bruce Momjian

Update mark/reset index code for multiple indexes, (OR code).

Thanks for Vadim for fixes.
parent 21ad8695
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.21 1998/08/01 22:44:52 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.22 1998/08/03 19:41:29 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -258,9 +258,8 @@ ExecIndexReScan(IndexScan *node, ExprContext *exprCtxt, Plan *parent) ...@@ -258,9 +258,8 @@ ExecIndexReScan(IndexScan *node, ExprContext *exprCtxt, Plan *parent)
if (exprCtxt == NULL) if (exprCtxt == NULL)
exprCtxt = node->scan.scanstate->cstate.cs_ExprContext; exprCtxt = node->scan.scanstate->cstate.cs_ExprContext;
if (exprCtxt != NULL) node->scan.scanstate->cstate.cs_ExprContext->ecxt_outertuple =
node->scan.scanstate->cstate.cs_ExprContext->ecxt_outertuple = exprCtxt->ecxt_outertuple;
exprCtxt->ecxt_outertuple;
/* /*
* get the index qualifications and recalculate the appropriate * get the index qualifications and recalculate the appropriate
...@@ -268,43 +267,40 @@ ExecIndexReScan(IndexScan *node, ExprContext *exprCtxt, Plan *parent) ...@@ -268,43 +267,40 @@ ExecIndexReScan(IndexScan *node, ExprContext *exprCtxt, Plan *parent)
*/ */
for (i = 0; i < numIndices; i++) for (i = 0; i < numIndices; i++)
{ {
if (runtimeKeyInfo && runtimeKeyInfo[i] != NULL) qual = nth(i, indxqual);
n_keys = numScanKeys[i];
run_keys = (int *) runtimeKeyInfo[i];
scan_keys = (ScanKey) scanKeys[i];
for (j = 0; j < n_keys; j++)
{ {
qual = nth(i, indxqual); /*
n_keys = numScanKeys[i]; * If we have a run-time key, then extract the run-time
run_keys = (int *) runtimeKeyInfo[i]; * expression and evaluate it with respect to the current
scan_keys = (ScanKey) scanKeys[i]; * outer tuple. We then stick the result into the scan key.
*/
for (j = 0; j < n_keys; j++) if (run_keys[j] != NO_OP)
{ {
clause = nth(j, qual);
scanexpr = (run_keys[j] == RIGHT_OP) ?
(Node *) get_rightop(clause) : (Node *) get_leftop(clause);
/* /*
* If we have a run-time key, then extract the run-time * pass in isDone but ignore it. We don't iterate in
* expression and evaluate it with respect to the current * quals
* outer tuple. We then stick the result into the scan key.
*/ */
if (run_keys[j] != NO_OP) scanvalue = (Datum)
{ ExecEvalExpr(scanexpr, exprCtxt, &isNull, &isDone);
clause = nth(j, qual); scan_keys[j].sk_argument = scanvalue;
scanexpr = (run_keys[j] == RIGHT_OP) ? if (isNull)
(Node *) get_rightop(clause) : (Node *) get_leftop(clause); scan_keys[j].sk_flags |= SK_ISNULL;
else
/* scan_keys[j].sk_flags &= ~SK_ISNULL;
* pass in isDone but ignore it. We don't iterate in
* quals
*/
scanvalue = (Datum)
ExecEvalExpr(scanexpr, exprCtxt, &isNull, &isDone);
scan_keys[j].sk_argument = scanvalue;
if (isNull)
scan_keys[j].sk_flags |= SK_ISNULL;
else
scan_keys[j].sk_flags &= ~SK_ISNULL;
}
} }
sdesc = scanDescs[i];
skey = scanKeys[i];
index_rescan(sdesc, direction, skey);
} }
sdesc = scanDescs[i];
skey = scanKeys[i];
index_rescan(sdesc, direction, skey);
} }
/* ---------------- /* ----------------
* perhaps return something meaningful * perhaps return something meaningful
...@@ -416,7 +412,7 @@ ExecIndexMarkPos(IndexScan *node) ...@@ -416,7 +412,7 @@ ExecIndexMarkPos(IndexScan *node)
int indexPtr; int indexPtr;
indexstate = node->indxstate; indexstate = node->indxstate;
indexPtr = indexstate->iss_IndexPtr; indexPtr = indexstate->iss_MarkIndexPtr = indexstate->iss_IndexPtr;
indexScanDescs = indexstate->iss_ScanDescs; indexScanDescs = indexstate->iss_ScanDescs;
scanDesc = indexScanDescs[indexPtr]; scanDesc = indexScanDescs[indexPtr];
...@@ -445,7 +441,7 @@ ExecIndexRestrPos(IndexScan *node) ...@@ -445,7 +441,7 @@ ExecIndexRestrPos(IndexScan *node)
int indexPtr; int indexPtr;
indexstate = node->indxstate; indexstate = node->indxstate;
indexPtr = indexstate->iss_IndexPtr; indexPtr = indexstate->iss_IndexPtr = indexstate->iss_MarkIndexPtr;
indexScanDescs = indexstate->iss_ScanDescs; indexScanDescs = indexstate->iss_ScanDescs;
scanDesc = indexScanDescs[indexPtr]; scanDesc = indexScanDescs[indexPtr];
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* *
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* $Id: execnodes.h,v 1.16 1998/07/27 19:38:34 vadim Exp $ * $Id: execnodes.h,v 1.17 1998/08/03 19:41:31 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -399,6 +399,7 @@ typedef struct IndexScanState ...@@ -399,6 +399,7 @@ typedef struct IndexScanState
CommonState cstate; /* its first field is NodeTag */ CommonState cstate; /* its first field is NodeTag */
int iss_NumIndices; int iss_NumIndices;
int iss_IndexPtr; int iss_IndexPtr;
int iss_MarkIndexPtr;
ScanKey *iss_ScanKeys; ScanKey *iss_ScanKeys;
int *iss_NumScanKeys; int *iss_NumScanKeys;
Pointer iss_RuntimeKeyInfo; Pointer iss_RuntimeKeyInfo;
......
...@@ -8,85 +8,63 @@ Inches ...@@ -8,85 +8,63 @@ Inches
4 0 -1 0 0 0 24 0.0000 4 330 1800 450 675 PostgreSQL\001 4 0 -1 0 0 0 24 0.0000 4 330 1800 450 675 PostgreSQL\001
4 0 -1 0 0 0 24 0.0000 4 330 1290 450 1095 Program\001 4 0 -1 0 0 0 24 0.0000 4 330 1290 450 1095 Program\001
-6 -6
6 5325 13125 7725 14400
2 4 0 1 -1 29 0 0 20 0.000 0 0 7 0 0 5
7725 14400 5325 14400 5325 13800 7725 13800 7725 14400
2 1 0 1 29 7 0 0 -1 0.000 0 0 -1 1 1 2
0 0 1.00 60.00 120.00
0 0 1.00 60.00 120.00
6450 13200 6450 13800
-6
2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1
8475 2175 8475 2175
2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1 2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1
8475 2175 8475 2175
2 4 0 1 -1 29 0 0 20 0.000 0 0 7 0 0 5 2 4 0 1 -1 29 0 0 20 0.000 0 0 7 0 0 5
2850 13200 450 13200 450 12600 2850 12600 2850 13200 2850 13200 450 13200 450 12600 2850 12600 2850 13200
2 1 0 1 29 7 0 0 -1 0.000 0 0 -1 1 1 2 2 1 0 2 29 7 0 0 -1 0.000 0 0 -1 1 1 2
0 0 1.00 60.00 120.00 0 0 2.00 150.00 180.00
0 0 1.00 60.00 120.00 0 0 2.00 150.00 180.00
1650 12600 1650 12000 1650 12600 1650 12000
2 4 0 1 -1 29 0 0 20 0.000 0 0 7 0 0 5 2 4 0 1 -1 29 0 0 20 0.000 0 0 7 0 0 5
9225 13200 6825 13200 6825 12600 9225 12600 9225 13200 9225 13200 6825 13200 6825 12600 9225 12600 9225 13200
2 1 0 1 29 7 0 0 -1 0.000 0 0 -1 1 1 2 2 1 0 2 29 7 0 0 -1 0.000 0 0 -1 1 1 2
0 0 1.00 60.00 120.00 0 0 2.00 150.00 180.00
0 0 1.00 60.00 120.00 0 0 2.00 150.00 180.00
8025 11925 8025 12525 8025 11925 8025 12525
2 4 0 1 -1 29 0 0 20 0.000 0 0 7 0 0 5 2 4 0 1 -1 29 0 0 20 0.000 0 0 7 0 0 5
6000 13200 3600 13200 3600 12600 6000 12600 6000 13200 6000 13200 3600 13200 3600 12600 6000 12600 6000 13200
2 1 0 1 29 7 0 0 -1 0.000 0 0 -1 1 1 2 2 1 0 2 29 7 0 0 -1 0.000 0 0 -1 1 1 2
0 0 1.00 60.00 120.00 0 0 2.00 150.00 180.00
0 0 1.00 60.00 120.00 0 0 2.00 150.00 180.00
4800 12600 4800 12000 4800 12600 4800 12000
2 4 0 1 -1 29 0 0 20 0.000 0 0 7 0 0 5 2 4 0 1 -1 29 0 0 20 0.000 0 0 7 0 0 5
4425 14400 2025 14400 2025 13800 4425 13800 4425 14400 4425 14400 2025 14400 2025 13800 4425 13800 4425 14400
2 1 0 1 29 7 0 0 -1 0.000 0 0 -1 1 1 2 2 1 0 2 29 7 0 0 -1 0.000 0 0 -1 1 1 2
0 0 1.00 60.00 120.00 0 0 2.00 150.00 180.00
0 0 1.00 60.00 120.00 0 0 2.00 150.00 180.00
3225 13200 3225 13800 3225 13200 3225 13800
2 1 0 1 8 7 0 0 -1 0.000 0 0 -1 1 0 2 2 1 0 2 8 7 0 0 -1 0.000 0 0 -1 1 0 2
0 0 1.00 60.00 120.00 0 0 2.00 150.00 180.00
2625 6675 2625 7275 2625 6675 2625 7275
2 1 0 1 19 7 0 0 -1 0.000 0 0 -1 1 0 2
0 0 1.00 60.00 120.00
2625 2775 2625 3375
2 4 0 1 -1 4 0 0 20 0.000 0 0 7 0 0 5 2 4 0 1 -1 4 0 0 20 0.000 0 0 7 0 0 5
3825 3975 1425 3975 1425 3375 3825 3375 3825 3975 3825 3975 1425 3975 1425 3375 3825 3375 3825 3975
2 1 0 1 20 7 0 0 -1 0.000 0 0 -1 1 0 2
0 0 1.00 60.00 120.00
2625 3975 2625 4575
2 1 0 1 20 7 0 0 -1 0.000 0 0 -1 1 0 2
0 0 1.00 60.00 120.00
2625 3975 6525 4575
2 4 0 1 -1 8 0 0 20 0.000 0 0 7 0 0 5 2 4 0 1 -1 8 0 0 20 0.000 0 0 7 0 0 5
3825 6675 1425 6675 1425 6075 3825 6075 3825 6675 3825 6675 1425 6675 1425 6075 3825 6075 3825 6675
2 4 0 1 -1 8 0 0 20 0.000 0 0 7 0 0 5
3825 7875 1425 7875 1425 7275 3825 7275 3825 7875
2 4 0 1 -1 8 0 0 20 0.000 0 0 7 0 0 5 2 4 0 1 -1 8 0 0 20 0.000 0 0 7 0 0 5
3825 9075 1425 9075 1425 8475 3825 8475 3825 9075 3825 9075 1425 9075 1425 8475 3825 8475 3825 9075
2 1 0 1 8 7 0 0 -1 0.000 0 0 -1 1 0 2 2 1 0 2 8 7 0 0 -1 0.000 0 0 -1 1 0 2
0 0 1.00 60.00 120.00 0 0 2.00 150.00 180.00
2625 7875 2625 8475 2625 7875 2625 8475
2 4 0 1 -1 8 0 0 20 0.000 0 0 7 0 0 5 2 4 0 1 -1 8 0 0 20 0.000 0 0 7 0 0 5
3825 10275 1425 10275 1425 9675 3825 9675 3825 10275 3825 10275 1425 10275 1425 9675 3825 9675 3825 10275
2 1 0 1 8 7 0 0 -1 0.000 0 0 -1 1 0 2 2 1 0 2 8 7 0 0 -1 0.000 0 0 -1 1 0 2
0 0 1.00 60.00 120.00 0 0 2.00 150.00 180.00
2625 9075 2625 9675 2625 9075 2625 9675
2 1 0 1 8 7 0 0 -1 0.000 0 0 -1 1 0 2 2 1 0 2 8 7 0 0 -1 0.000 0 0 -1 1 0 2
0 0 1.00 60.00 120.00 0 0 2.00 150.00 180.00
2625 10275 2625 10875 2625 10275 2625 10875
2 4 0 1 -1 8 0 0 20 0.000 0 0 7 0 0 5 2 4 0 1 -1 8 0 0 20 0.000 0 0 7 0 0 5
7725 7875 5325 7875 5325 7275 7725 7275 7725 7875 7725 7875 5325 7875 5325 7275 7725 7275 7725 7875
2 1 0 1 8 7 0 0 -1 0.000 0 0 -1 1 0 2 2 1 0 2 8 7 0 0 -1 0.000 0 0 -1 1 0 2
0 0 1.00 60.00 120.00 0 0 2.00 150.00 180.00
3825 7575 5325 7575
2 1 0 1 8 7 0 0 -1 0.000 0 0 -1 1 0 2
0 0 1.00 60.00 120.00
2625 5775 2625 6075 2625 5775 2625 6075
2 4 0 1 -1 8 0 0 20 0.000 0 0 7 0 0 5 2 4 0 1 -1 8 0 0 20 0.000 0 0 7 0 0 5
3825 11475 1425 11475 1425 10875 3825 10875 3825 11475 3825 11475 1425 11475 1425 10875 3825 10875 3825 11475
2 1 0 1 31 7 0 0 -1 0.000 0 0 -1 1 0 2 2 1 0 2 31 7 0 0 -1 0.000 0 0 -1 1 0 2
0 0 1.00 60.00 120.00 0 0 2.00 150.00 180.00
2625 5175 2625 5775 2625 5175 2625 5775
2 4 0 1 -1 31 0 0 20 0.000 0 0 7 0 0 5 2 4 0 1 -1 31 0 0 20 0.000 0 0 7 0 0 5
3825 5175 1425 5175 1425 4575 3825 4575 3825 5175 3825 5175 1425 5175 1425 4575 3825 4575 3825 5175
...@@ -96,24 +74,44 @@ Inches ...@@ -96,24 +74,44 @@ Inches
8775 11775 375 11775 375 5625 8775 5625 8775 11775 8775 11775 375 11775 375 5625 8775 5625 8775 11775
2 4 0 1 -1 0 0 0 20 0.000 0 0 7 0 0 5 2 4 0 1 -1 0 0 0 20 0.000 0 0 7 0 0 5
7725 3375 5325 3375 5325 2775 7725 2775 7725 3375 7725 3375 5325 3375 5325 2775 7725 2775 7725 3375
2 1 1 1 -1 7 0 0 -1 3.000 0 0 -1 1 1 2
0 0 1.00 60.00 120.00
0 0 1.00 60.00 120.00
4660 3324 5295 3093
2 1 1 1 -1 7 0 0 -1 4.000 0 0 -1 1 1 2
0 0 1.00 60.00 120.00
0 0 1.00 60.00 120.00
4890 3708 5325 3150
2 4 0 1 -1 26 0 0 20 0.000 0 0 7 0 0 5
3825 2775 1425 2775 1425 2175 3825 2175 3825 2775
2 4 0 1 -1 23 0 0 20 0.000 0 0 8 0 0 5 2 4 0 1 -1 23 0 0 20 0.000 0 0 8 0 0 5
2925 15675 525 15675 525 15075 2925 15075 2925 15675 2925 15675 525 15675 525 15075 2925 15075 2925 15675
3 0 0 1 8 7 0 0 -1 0.000 0 1 0 5 2 1 0 2 25 7 0 0 -1 0.000 0 0 -1 1 0 2
0 0 1.00 60.00 120.00 0 0 2.00 150.00 180.50
7725 7575 8325 7275 8325 6375 7950 5775 2625 5775 2625 2775 2625 3375
3 0 0 1 8 7 0 0 -1 0.000 0 1 0 5 2 4 0 1 -1 26 0 0 20 0.000 0 0 7 0 0 5
0 0 1.00 60.00 120.00 3825 2775 1425 2775 1425 2175 3825 2175 3825 2775
1425 11175 750 10725 750 6225 1425 5775 2625 5775 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
2625 3975 2625 4575
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
2625 3975 6525 4575
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
4890 3708 5325 3150
2 4 0 1 -1 29 0 0 20 0.000 0 0 7 0 0 5
7725 14400 5325 14400 5325 13800 7725 13800 7725 14400
2 1 0 2 29 7 0 0 -1 0.000 0 0 -1 1 1 2
0 0 2.00 150.00 180.00
0 0 2.00 150.00 180.00
6450 13200 6450 13800
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
3825 7575 5325 7575
2 4 0 1 -1 8 0 0 20 0.000 0 0 7 0 0 5
3825 7875 1425 7875 1425 7275 3825 7275 3825 7875
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
4735 3324 5370 3093
3 0 0 2 8 7 0 0 -1 0.000 0 1 0 5
0 0 2.00 150.00 180.00
7725 7575 8325 7275 8325 6375 7800 5775 2625 5775
3 0 0 2 8 7 0 0 -1 0.000 0 1 0 5
0 0 2.00 150.00 180.00
1425 11175 825 10725 825 6225 1575 5775 2625 5775
4 1 -1 0 0 28 18 0.0000 4 195 1050 1635 12990 Utilities\001 4 1 -1 0 0 28 18 0.0000 4 195 1050 1635 12990 Utilities\001
4 1 -1 0 0 28 18 0.0000 4 240 2325 8040 12990 Storage Managers\001 4 1 -1 0 0 28 18 0.0000 4 240 2325 8040 12990 Storage Managers\001
4 1 -1 0 0 0 18 0.0000 4 255 840 4800 12975 Catalog\001 4 1 -1 0 0 0 18 0.0000 4 255 840 4800 12975 Catalog\001
......
src/tools/backend/flow.jpg

72.5 KB | W: | H:

src/tools/backend/flow.jpg

74.4 KB | W: | H:

src/tools/backend/flow.jpg
src/tools/backend/flow.jpg
src/tools/backend/flow.jpg
src/tools/backend/flow.jpg
  • 2-up
  • Swipe
  • Onion skin
...@@ -11,10 +11,6 @@ by Bruce Momjian ...@@ -11,10 +11,6 @@ by Bruce Momjian
</H2> </H2>
<P> <P>
<CENTER> <CENTER>
<EM><BIG>
Click on an item to see more detail or look at the full
<A HREF="backend_dirs.html">index.</A>
</BIG></EM>
<BR> <BR>
<BR> <BR>
<IMG src="flow.jpg" usemap="#flowmap" alt="flowchart"> <IMG src="flow.jpg" usemap="#flowmap" alt="flowchart">
...@@ -38,10 +34,12 @@ Click on an item to see more detail or look at the full ...@@ -38,10 +34,12 @@ Click on an item to see more detail or look at the full
<AREA COORDS="340,900,500,950" HREF="backend_dirs.html#nodes"> <AREA COORDS="340,900,500,950" HREF="backend_dirs.html#nodes">
<AREA COORDS="20,990,180,1030" HREF="backend_dirs.html#bootstrap"> <AREA COORDS="20,990,180,1030" HREF="backend_dirs.html#bootstrap">
</MAP> </MAP>
<CENTER><EM>
Click on an item to see more detail or look at the full
<A HREF="backend_dirs.html">index.</A>
</EM></CENTER>
<BR> <BR>
<P>
<HR>
<P> <P>
A query comes to the backend via data packets arriving through TCP/IP or A query comes to the backend via data packets arriving through TCP/IP or
...@@ -117,8 +115,8 @@ can be accessed by clicking on the flowchart.<P> ...@@ -117,8 +115,8 @@ can be accessed by clicking on the flowchart.<P>
Another area of interest is the shared memory area, which contains data Another area of interest is the shared memory area, which contains data
accessable to all backends. It has table recently used data/index accessable to all backends. It has recently used data/index blocks,
blocks, locks, backend information, and lookup tables for these locks, backend process information, and lookup tables for these
structures: structures:
<UL> <UL>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment