diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-06-29 00:33:44 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-06-29 00:33:44 +0000 |
commit | bee217924d51af8cf0411167bfc8a7eb55122577 (patch) | |
tree | ab6d3f311de5fd6b415e0bdf032205ed503ba95c /src/backend/optimizer/path/costsize.c | |
parent | df7618020b3845a51d1ba80cb9abfc6df5dfeaff (diff) | |
download | postgresql-bee217924d51af8cf0411167bfc8a7eb55122577.tar.gz postgresql-bee217924d51af8cf0411167bfc8a7eb55122577.zip |
Support expressions of the form 'scalar op ANY (array)' and
'scalar op ALL (array)', where the operator is applied between the
lefthand scalar and each element of the array. The operator must
yield boolean; the result of the construct is the OR or AND of the
per-element results, respectively.
Original coding by Joe Conway, after an idea of Peter's. Rewritten
by Tom to keep the implementation strictly separate from subqueries.
Diffstat (limited to 'src/backend/optimizer/path/costsize.c')
-rw-r--r-- | src/backend/optimizer/path/costsize.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/backend/optimizer/path/costsize.c b/src/backend/optimizer/path/costsize.c index 21bc152ce6e..283987b63d5 100644 --- a/src/backend/optimizer/path/costsize.c +++ b/src/backend/optimizer/path/costsize.c @@ -49,7 +49,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/path/costsize.c,v 1.107 2003/02/16 02:30:38 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/path/costsize.c,v 1.108 2003/06/29 00:33:43 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1473,6 +1473,11 @@ cost_qual_eval_walker(Node *node, QualCost *total) { total->per_tuple += cpu_operator_cost; } + else if (IsA(node, ScalarArrayOpExpr)) + { + /* should charge more than 1 op cost, but how many? */ + total->per_tuple += cpu_operator_cost * 10; + } else if (IsA(node, SubLink)) { /* This routine should not be applied to un-planned expressions */ |