Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9be7ea0

Browse files
committed
Remove unneeded indxqual field in IndexScanState, and the useless work
spent initializing it during indexscan startup.
1 parent 303f464 commit 9be7ea0

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/backend/executor/nodeIndexscan.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/executor/nodeIndexscan.c,v 1.91 2004/02/03 17:34:02 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/executor/nodeIndexscan.c,v 1.92 2004/02/28 19:46:05 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -669,16 +669,19 @@ ExecInitIndexScan(IndexScan *node, EState *estate)
669669

670670
/*
671671
* initialize child expressions
672+
*
673+
* Note: we don't initialize all of the indxqual expression, only the
674+
* sub-parts corresponding to runtime keys (see below). The indxqualorig
675+
* expression is always initialized even though it will only be used in
676+
* some uncommon cases --- would be nice to improve that. (Problem is
677+
* that any SubPlans present in the expression must be found now...)
672678
*/
673679
indexstate->ss.ps.targetlist = (List *)
674680
ExecInitExpr((Expr *) node->scan.plan.targetlist,
675681
(PlanState *) indexstate);
676682
indexstate->ss.ps.qual = (List *)
677683
ExecInitExpr((Expr *) node->scan.plan.qual,
678684
(PlanState *) indexstate);
679-
indexstate->indxqual = (List *)
680-
ExecInitExpr((Expr *) node->indxqual,
681-
(PlanState *) indexstate);
682685
indexstate->indxqualorig = (List *)
683686
ExecInitExpr((Expr *) node->indxqualorig,
684687
(PlanState *) indexstate);

src/include/nodes/execnodes.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/include/nodes/execnodes.h,v 1.111 2004/01/22 02:23:21 tgl Exp $
10+
* $PostgreSQL: pgsql/src/include/nodes/execnodes.h,v 1.112 2004/02/28 19:46:06 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -765,8 +765,10 @@ typedef ScanState SeqScanState;
765765
/* ----------------
766766
* IndexScanState information
767767
*
768+
* indxqualorig execution state for indxqualorig expressions
768769
* NumIndices number of indices in this scan
769770
* IndexPtr current index in use
771+
* MarkIndexPtr IndexPtr for marked scan point
770772
* ScanKeys Skey structures to scan index rels
771773
* NumScanKeys array of no of keys in each Skey struct
772774
* RuntimeKeyInfo array of array of exprstates for Skeys
@@ -783,7 +785,6 @@ typedef ScanState SeqScanState;
783785
typedef struct IndexScanState
784786
{
785787
ScanState ss; /* its first field is NodeTag */
786-
List *indxqual;
787788
List *indxqualorig;
788789
int iss_NumIndices;
789790
int iss_IndexPtr;

0 commit comments

Comments
 (0)