Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit439a2af

Browse files
committed
Update mark/reset index code for multiple indexes, (OR code).
Thanks for Vadim for fixes.
1 parent21ad869 commit439a2af

File tree

5 files changed

+101
-108
lines changed

5 files changed

+101
-108
lines changed

‎src/backend/executor/nodeIndexscan.c

Lines changed: 33 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.21 1998/08/01 22:44:52 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.22 1998/08/03 19:41:29 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -258,53 +258,49 @@ ExecIndexReScan(IndexScan *node, ExprContext *exprCtxt, Plan *parent)
258258
if (exprCtxt==NULL)
259259
exprCtxt=node->scan.scanstate->cstate.cs_ExprContext;
260260

261-
if (exprCtxt!=NULL)
262-
node->scan.scanstate->cstate.cs_ExprContext->ecxt_outertuple=
263-
exprCtxt->ecxt_outertuple;
261+
node->scan.scanstate->cstate.cs_ExprContext->ecxt_outertuple=
262+
exprCtxt->ecxt_outertuple;
264263

265264
/*
266265
* get the index qualifications and recalculate the appropriate
267266
* values
268267
*/
269268
for (i=0;i<numIndices;i++)
270269
{
271-
if (runtimeKeyInfo&&runtimeKeyInfo[i]!=NULL)
270+
qual=nth(i,indxqual);
271+
n_keys=numScanKeys[i];
272+
run_keys= (int*)runtimeKeyInfo[i];
273+
scan_keys= (ScanKey)scanKeys[i];
274+
275+
for (j=0;j<n_keys;j++)
272276
{
273-
qual=nth(i,indxqual);
274-
n_keys=numScanKeys[i];
275-
run_keys= (int*)runtimeKeyInfo[i];
276-
scan_keys= (ScanKey)scanKeys[i];
277-
278-
for (j=0;j<n_keys;j++)
277+
/*
278+
* If we have a run-time key, then extract the run-time
279+
* expression and evaluate it with respect to the current
280+
* outer tuple. We then stick the result into the scan key.
281+
*/
282+
if (run_keys[j]!=NO_OP)
279283
{
284+
clause=nth(j,qual);
285+
scanexpr= (run_keys[j]==RIGHT_OP) ?
286+
(Node*)get_rightop(clause) : (Node*)get_leftop(clause);
287+
280288
/*
281-
* If we have a run-time key, then extract the run-time
282-
* expression and evaluate it with respect to the current
283-
* outer tuple. We then stick the result into the scan key.
289+
* pass in isDone but ignore it. We don't iterate in
290+
* quals
284291
*/
285-
if (run_keys[j]!=NO_OP)
286-
{
287-
clause=nth(j,qual);
288-
scanexpr= (run_keys[j]==RIGHT_OP) ?
289-
(Node*)get_rightop(clause) : (Node*)get_leftop(clause);
290-
291-
/*
292-
* pass in isDone but ignore it. We don't iterate in
293-
* quals
294-
*/
295-
scanvalue= (Datum)
296-
ExecEvalExpr(scanexpr,exprCtxt,&isNull,&isDone);
297-
scan_keys[j].sk_argument=scanvalue;
298-
if (isNull)
299-
scan_keys[j].sk_flags |=SK_ISNULL;
300-
else
301-
scan_keys[j].sk_flags &= ~SK_ISNULL;
302-
}
292+
scanvalue= (Datum)
293+
ExecEvalExpr(scanexpr,exprCtxt,&isNull,&isDone);
294+
scan_keys[j].sk_argument=scanvalue;
295+
if (isNull)
296+
scan_keys[j].sk_flags |=SK_ISNULL;
297+
else
298+
scan_keys[j].sk_flags &= ~SK_ISNULL;
303299
}
304-
sdesc=scanDescs[i];
305-
skey=scanKeys[i];
306-
index_rescan(sdesc,direction,skey);
307300
}
301+
sdesc=scanDescs[i];
302+
skey=scanKeys[i];
303+
index_rescan(sdesc,direction,skey);
308304
}
309305
/* ----------------
310306
*perhaps return something meaningful
@@ -416,7 +412,7 @@ ExecIndexMarkPos(IndexScan *node)
416412
intindexPtr;
417413

418414
indexstate=node->indxstate;
419-
indexPtr=indexstate->iss_IndexPtr;
415+
indexPtr=indexstate->iss_MarkIndexPtr=indexstate->iss_IndexPtr;
420416
indexScanDescs=indexstate->iss_ScanDescs;
421417
scanDesc=indexScanDescs[indexPtr];
422418

@@ -445,7 +441,7 @@ ExecIndexRestrPos(IndexScan *node)
445441
intindexPtr;
446442

447443
indexstate=node->indxstate;
448-
indexPtr=indexstate->iss_IndexPtr;
444+
indexPtr=indexstate->iss_IndexPtr=indexstate->iss_MarkIndexPtr;
449445
indexScanDescs=indexstate->iss_ScanDescs;
450446
scanDesc=indexScanDescs[indexPtr];
451447

‎src/include/nodes/execnodes.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: execnodes.h,v 1.16 1998/07/27 19:38:34 vadim Exp $
9+
* $Id: execnodes.h,v 1.17 1998/08/03 19:41:31 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -399,6 +399,7 @@ typedef struct IndexScanState
399399
CommonStatecstate;/* its first field is NodeTag */
400400
intiss_NumIndices;
401401
intiss_IndexPtr;
402+
intiss_MarkIndexPtr;
402403
ScanKey*iss_ScanKeys;
403404
int*iss_NumScanKeys;
404405
Pointeriss_RuntimeKeyInfo;

‎src/tools/backend/flow.fig

Lines changed: 60 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -8,85 +8,63 @@ Inches
88
4 0 -1 0 0 0 24 0.0000 4 330 1800 450 675 PostgreSQL\001
99
4 0 -1 0 0 0 24 0.0000 4 330 1290 450 1095 Program\001
1010
-6
11-
6 5325 13125 7725 14400
12-
2 4 0 1 -1 29 0 0 20 0.000 0 0 7 0 0 5
13-
7725 14400 5325 14400 5325 13800 7725 13800 7725 14400
14-
2 1 0 1 29 7 0 0 -1 0.000 0 0 -1 1 1 2
15-
0 0 1.00 60.00 120.00
16-
0 0 1.00 60.00 120.00
17-
6450 13200 6450 13800
18-
-6
1911
2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1
2012
8475 2175
2113
2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 1
2214
8475 2175
2315
2 4 0 1 -1 29 0 0 20 0.000 0 0 7 0 0 5
2416
2850 13200 450 13200 450 12600 2850 12600 2850 13200
25-
2 1 01 29 7 0 0 -1 0.000 0 0 -1 1 1 2
26-
0 01.0060.00120.00
27-
0 01.0060.00120.00
17+
2 1 02 29 7 0 0 -1 0.000 0 0 -1 1 1 2
18+
0 02.00150.00180.00
19+
0 02.00150.00180.00
2820
1650 12600 1650 12000
2921
2 4 0 1 -1 29 0 0 20 0.000 0 0 7 0 0 5
3022
9225 13200 6825 13200 6825 12600 9225 12600 9225 13200
31-
2 1 01 29 7 0 0 -1 0.000 0 0 -1 1 1 2
32-
0 01.0060.00120.00
33-
0 01.0060.00120.00
23+
2 1 02 29 7 0 0 -1 0.000 0 0 -1 1 1 2
24+
0 02.00150.00180.00
25+
0 02.00150.00180.00
3426
8025 11925 8025 12525
3527
2 4 0 1 -1 29 0 0 20 0.000 0 0 7 0 0 5
3628
6000 13200 3600 13200 3600 12600 6000 12600 6000 13200
37-
2 1 01 29 7 0 0 -1 0.000 0 0 -1 1 1 2
38-
0 01.0060.00120.00
39-
0 01.0060.00120.00
29+
2 1 02 29 7 0 0 -1 0.000 0 0 -1 1 1 2
30+
0 02.00150.00180.00
31+
0 02.00150.00180.00
4032
4800 12600 4800 12000
4133
2 4 0 1 -1 29 0 0 20 0.000 0 0 7 0 0 5
4234
4425 14400 2025 14400 2025 13800 4425 13800 4425 14400
43-
2 1 01 29 7 0 0 -1 0.000 0 0 -1 1 1 2
44-
0 01.0060.00120.00
45-
0 01.0060.00120.00
35+
2 1 02 29 7 0 0 -1 0.000 0 0 -1 1 1 2
36+
0 02.00150.00180.00
37+
0 02.00150.00180.00
4638
3225 13200 3225 13800
47-
2 1 01 8 7 0 0 -1 0.000 0 0 -1 1 0 2
48-
0 01.0060.00120.00
39+
2 1 02 8 7 0 0 -1 0.000 0 0 -1 1 0 2
40+
0 02.00150.00180.00
4941
2625 6675 2625 7275
50-
2 1 0 1 19 7 0 0 -1 0.000 0 0 -1 1 0 2
51-
0 0 1.00 60.00 120.00
52-
2625 2775 2625 3375
5342
2 4 0 1 -1 4 0 0 20 0.000 0 0 7 0 0 5
5443
3825 3975 1425 3975 1425 3375 3825 3375 3825 3975
55-
2 1 0 1 20 7 0 0 -1 0.000 0 0 -1 1 0 2
56-
0 0 1.00 60.00 120.00
57-
2625 3975 2625 4575
58-
2 1 0 1 20 7 0 0 -1 0.000 0 0 -1 1 0 2
59-
0 0 1.00 60.00 120.00
60-
2625 3975 6525 4575
6144
2 4 0 1 -1 8 0 0 20 0.000 0 0 7 0 0 5
6245
3825 6675 1425 6675 1425 6075 3825 6075 3825 6675
63-
2 4 0 1 -1 8 0 0 20 0.000 0 0 7 0 0 5
64-
3825 7875 1425 7875 1425 7275 3825 7275 3825 7875
6546
2 4 0 1 -1 8 0 0 20 0.000 0 0 7 0 0 5
6647
3825 9075 1425 9075 1425 8475 3825 8475 3825 9075
67-
2 1 01 8 7 0 0 -1 0.000 0 0 -1 1 0 2
68-
0 01.0060.00120.00
48+
2 1 02 8 7 0 0 -1 0.000 0 0 -1 1 0 2
49+
0 02.00150.00180.00
6950
2625 7875 2625 8475
7051
2 4 0 1 -1 8 0 0 20 0.000 0 0 7 0 0 5
7152
3825 10275 1425 10275 1425 9675 3825 9675 3825 10275
72-
2 1 01 8 7 0 0 -1 0.000 0 0 -1 1 0 2
73-
0 01.0060.00120.00
53+
2 1 02 8 7 0 0 -1 0.000 0 0 -1 1 0 2
54+
0 02.00150.00180.00
7455
2625 9075 2625 9675
75-
2 1 01 8 7 0 0 -1 0.000 0 0 -1 1 0 2
76-
0 01.0060.00120.00
56+
2 1 02 8 7 0 0 -1 0.000 0 0 -1 1 0 2
57+
0 02.00150.00180.00
7758
2625 10275 2625 10875
7859
2 4 0 1 -1 8 0 0 20 0.000 0 0 7 0 0 5
7960
7725 7875 5325 7875 5325 7275 7725 7275 7725 7875
80-
2 1 0 1 8 7 0 0 -1 0.000 0 0 -1 1 0 2
81-
0 0 1.00 60.00 120.00
82-
3825 7575 5325 7575
83-
2 1 0 1 8 7 0 0 -1 0.000 0 0 -1 1 0 2
84-
0 0 1.00 60.00 120.00
61+
2 1 0 2 8 7 0 0 -1 0.000 0 0 -1 1 0 2
62+
0 0 2.00 150.00 180.00
8563
2625 5775 2625 6075
8664
2 4 0 1 -1 8 0 0 20 0.000 0 0 7 0 0 5
8765
3825 11475 1425 11475 1425 10875 3825 10875 3825 11475
88-
2 1 01 31 7 0 0 -1 0.000 0 0 -1 1 0 2
89-
0 01.0060.00120.00
66+
2 1 02 31 7 0 0 -1 0.000 0 0 -1 1 0 2
67+
0 02.00150.00180.00
9068
2625 5175 2625 5775
9169
2 4 0 1 -1 31 0 0 20 0.000 0 0 7 0 0 5
9270
3825 5175 1425 5175 1425 4575 3825 4575 3825 5175
@@ -96,24 +74,44 @@ Inches
9674
8775 11775 375 11775 375 5625 8775 5625 8775 11775
9775
2 4 0 1 -1 0 0 0 20 0.000 0 0 7 0 0 5
9876
7725 3375 5325 3375 5325 2775 7725 2775 7725 3375
99-
2 1 1 1 -1 7 0 0 -1 3.000 0 0 -1 1 1 2
100-
0 0 1.00 60.00 120.00
101-
0 0 1.00 60.00 120.00
102-
4660 3324 5295 3093
103-
2 1 1 1 -1 7 0 0 -1 4.000 0 0 -1 1 1 2
104-
0 0 1.00 60.00 120.00
105-
0 0 1.00 60.00 120.00
106-
4890 3708 5325 3150
107-
2 4 0 1 -1 26 0 0 20 0.000 0 0 7 0 0 5
108-
3825 2775 1425 2775 1425 2175 3825 2175 3825 2775
10977
2 4 0 1 -1 23 0 0 20 0.000 0 0 8 0 0 5
11078
2925 15675 525 15675 525 15075 2925 15075 2925 15675
111-
3 0 0 1 8 7 0 0 -1 0.000 0 1 0 5
112-
0 0 1.00 60.00 120.00
113-
7725 7575 8325 7275 8325 6375 7950 5775 2625 5775
114-
3 0 0 1 8 7 0 0 -1 0.000 0 1 0 5
115-
0 0 1.00 60.00 120.00
116-
1425 11175 750 10725 750 6225 1425 5775 2625 5775
79+
2 1 0 2 25 7 0 0 -1 0.000 0 0 -1 1 0 2
80+
0 0 2.00 150.00 180.50
81+
2625 2775 2625 3375
82+
2 4 0 1 -1 26 0 0 20 0.000 0 0 7 0 0 5
83+
3825 2775 1425 2775 1425 2175 3825 2175 3825 2775
84+
2 1 0 2 20 7 0 0 -1 0.000 0 0 -1 1 0 2
85+
0 0 2.00 150.00 180.00
86+
2625 3975 2625 4575
87+
2 1 0 2 20 7 0 0 -1 0.000 0 0 -1 1 0 2
88+
0 0 2.00 150.00 180.00
89+
2625 3975 6525 4575
90+
2 1 1 2 -1 7 0 0 -1 4.000 0 0 -1 1 1 2
91+
0 0 2.00 150.00 180.00
92+
0 0 2.00 150.00 180.00
93+
4890 3708 5325 3150
94+
2 4 0 1 -1 29 0 0 20 0.000 0 0 7 0 0 5
95+
7725 14400 5325 14400 5325 13800 7725 13800 7725 14400
96+
2 1 0 2 29 7 0 0 -1 0.000 0 0 -1 1 1 2
97+
0 0 2.00 150.00 180.00
98+
0 0 2.00 150.00 180.00
99+
6450 13200 6450 13800
100+
2 1 0 2 8 7 0 0 -1 0.000 0 0 -1 1 0 2
101+
0 0 2.00 150.00 180.00
102+
3825 7575 5325 7575
103+
2 4 0 1 -1 8 0 0 20 0.000 0 0 7 0 0 5
104+
3825 7875 1425 7875 1425 7275 3825 7275 3825 7875
105+
2 1 1 2 -1 7 0 0 -1 3.000 0 0 -1 1 1 2
106+
0 0 2.00 150.00 180.00
107+
0 0 2.00 150.00 180.00
108+
4735 3324 5370 3093
109+
3 0 0 2 8 7 0 0 -1 0.000 0 1 0 5
110+
0 0 2.00 150.00 180.00
111+
7725 7575 8325 7275 8325 6375 7800 5775 2625 5775
112+
3 0 0 2 8 7 0 0 -1 0.000 0 1 0 5
113+
0 0 2.00 150.00 180.00
114+
1425 11175 825 10725 825 6225 1575 5775 2625 5775
117115
4 1 -1 0 0 28 18 0.0000 4 195 1050 1635 12990 Utilities\001
118116
4 1 -1 0 0 28 18 0.0000 4 240 2325 8040 12990 Storage Managers\001
119117
4 1 -1 0 0 0 18 0.0000 4 255 840 4800 12975 Catalog\001

‎src/tools/backend/flow.jpg

1.92 KB
Loading

‎src/tools/backend/index.html

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ <H2 ALIGN=CENTER>
1111
</H2>
1212
<P>
1313
<CENTER>
14-
<EM><BIG>
15-
Click on an item to see more detail or look at the full
16-
<AHREF="backend_dirs.html">index.</A>
17-
</BIG></EM>
1814
<BR>
1915
<BR>
2016
<IMGsrc="flow.jpg"usemap="#flowmap"alt="flowchart">
@@ -38,10 +34,12 @@ <H2 ALIGN=CENTER>
3834
<AREACOORDS="340,900,500,950"HREF="backend_dirs.html#nodes">
3935
<AREACOORDS="20,990,180,1030"HREF="backend_dirs.html#bootstrap">
4036
</MAP>
37+
<CENTER><EM>
38+
Click on an item to see more detail or look at the full
39+
<AHREF="backend_dirs.html">index.</A>
40+
</EM></CENTER>
4141
<BR>
42-
<P>
4342

44-
<HR>
4543
<P>
4644

4745
A query comes to the backend via data packets arriving through TCP/IP or
@@ -117,8 +115,8 @@ <H2 ALIGN=CENTER>
117115

118116

119117
Another area of interest is the shared memory area, which contains data
120-
accessable to all backends. It hastablerecently used data/index
121-
blocks,locks, backend information, and lookup tables for these
118+
accessable to all backends. It has recently used data/index blocks,
119+
locks, backend process information, and lookup tables for these
122120
structures:
123121

124122
<UL>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp