1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-02 09:02:37 +03:00

Since createplan.c no longer cares whether index operators are lossy, it has

no particular need to do get_op_opfamily_properties() while building an
indexscan plan.  Postpone that lookup until executor start.  This simplifies
createplan.c a lot more than it complicates nodeIndexscan.c, and makes things
more uniform since we already had to do it that way for RowCompare
expressions.  Should be a bit faster too, at least for plans that aren't
re-used many times, since we avoid palloc'ing and perhaps copying the
intermediate list data structure.
This commit is contained in:
Tom Lane
2008-04-13 20:51:21 +00:00
parent 24558da14a
commit 226837e57e
13 changed files with 96 additions and 219 deletions

View File

@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/optimizer/path/indxpath.c,v 1.228 2008/03/25 22:42:43 tgl Exp $
* $PostgreSQL: pgsql/src/backend/optimizer/path/indxpath.c,v 1.229 2008/04/13 20:51:20 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -2465,7 +2465,6 @@ expand_indexqual_rowcompare(RestrictInfo *rinfo,
int op_strategy;
Oid op_lefttype;
Oid op_righttype;
bool op_recheck;
int matching_cols;
Oid expr_op;
List *opfamilies;
@ -2488,8 +2487,7 @@ expand_indexqual_rowcompare(RestrictInfo *rinfo,
get_op_opfamily_properties(expr_op, index->opfamily[indexcol],
&op_strategy,
&op_lefttype,
&op_righttype,
&op_recheck);
&op_righttype);
/* Build lists of the opfamilies and operator datatypes in case needed */
opfamilies = list_make1_oid(index->opfamily[indexcol]);
lefttypes = list_make1_oid(op_lefttype);
@ -2557,8 +2555,7 @@ expand_indexqual_rowcompare(RestrictInfo *rinfo,
get_op_opfamily_properties(expr_op, index->opfamily[i],
&op_strategy,
&op_lefttype,
&op_righttype,
&op_recheck);
&op_righttype);
opfamilies = lappend_oid(opfamilies, index->opfamily[i]);
lefttypes = lappend_oid(lefttypes, op_lefttype);
righttypes = lappend_oid(righttypes, op_righttype);