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

Commit 6cb1c02

Browse files
committed
Rewrite OR indexscan processing to be more flexible. We can now for the
first time generate an OR indexscan for a two-column index when the WHERE condition is like 'col1 = foo AND (col2 = bar OR col2 = baz)' --- before, the OR had to be on the first column of the index or we'd not notice the possibility of using it. Some progress towards extracting OR indexscans from subclauses of an OR that references multiple relations, too, although this code is #ifdef'd out because it needs more work.
1 parent 037e2fc commit 6cb1c02

File tree

11 files changed

+448
-503
lines changed

11 files changed

+448
-503
lines changed

src/backend/nodes/copyfuncs.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* Portions Copyright (c) 1994, Regents of the University of California
1616
*
1717
* IDENTIFICATION
18-
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.270 2003/12/30 23:53:14 tgl Exp $
18+
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.271 2004/01/04 00:07:32 tgl Exp $
1919
*
2020
*-------------------------------------------------------------------------
2121
*/
@@ -1172,7 +1172,7 @@ _copyRestrictInfo(RestrictInfo *from)
11721172
COPY_SCALAR_FIELD(canjoin);
11731173
COPY_BITMAPSET_FIELD(left_relids);
11741174
COPY_BITMAPSET_FIELD(right_relids);
1175-
COPY_NODE_FIELD(subclauseindices); /* XXX probably bad */
1175+
COPY_NODE_FIELD(orclause);
11761176
COPY_SCALAR_FIELD(eval_cost);
11771177
COPY_SCALAR_FIELD(this_selec);
11781178
COPY_SCALAR_FIELD(mergejoinoperator);

src/backend/nodes/outfuncs.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.223 2003/12/30 23:53:14 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.224 2004/01/04 00:07:32 tgl Exp $
1212
*
1313
* NOTES
1414
* Every node type that can appear in stored rules' parsetrees *must*
@@ -1077,7 +1077,7 @@ _outRestrictInfo(StringInfo str, RestrictInfo *node)
10771077
WRITE_BOOL_FIELD(canjoin);
10781078
WRITE_BITMAPSET_FIELD(left_relids);
10791079
WRITE_BITMAPSET_FIELD(right_relids);
1080-
WRITE_NODE_FIELD(subclauseindices);
1080+
WRITE_NODE_FIELD(orclause);
10811081
WRITE_OID_FIELD(mergejoinoperator);
10821082
WRITE_OID_FIELD(left_sortop);
10831083
WRITE_OID_FIELD(right_sortop);

0 commit comments

Comments
 (0)