diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2000-09-29 18:21:41 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2000-09-29 18:21:41 +0000 |
commit | 3a94e789f5c9537d804210be3cb26f7fb08e3b9e (patch) | |
tree | f1eac12405e3c0ded881d7dd7e59cec35b30c335 /src/backend/optimizer/path/indxpath.c | |
parent | 6f64c2e54a0b14154a335249f4dca91a39c61c50 (diff) | |
download | postgresql-3a94e789f5c9537d804210be3cb26f7fb08e3b9e.tar.gz postgresql-3a94e789f5c9537d804210be3cb26f7fb08e3b9e.zip |
Subselects in FROM clause, per ISO syntax: FROM (SELECT ...) [AS] alias.
(Don't forget that an alias is required.) Views reimplemented as expanding
to subselect-in-FROM. Grouping, aggregates, DISTINCT in views actually
work now (he says optimistically). No UNION support in subselects/views
yet, but I have some ideas about that. Rule-related permissions checking
moved out of rewriter and into executor.
INITDB REQUIRED!
Diffstat (limited to 'src/backend/optimizer/path/indxpath.c')
-rw-r--r-- | src/backend/optimizer/path/indxpath.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/backend/optimizer/path/indxpath.c b/src/backend/optimizer/path/indxpath.c index 55bbd5f5983..5ed42accdb0 100644 --- a/src/backend/optimizer/path/indxpath.c +++ b/src/backend/optimizer/path/indxpath.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.96 2000/09/15 18:45:25 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.97 2000/09/29 18:21:32 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -464,7 +464,7 @@ extract_or_indexqual_conditions(RelOptInfo *rel, else { /* we assume the caller passed a valid indexable qual */ - quals = lcons(orsubclause, NIL); + quals = makeList1(orsubclause); } return expand_indexqual_conditions(quals); @@ -1504,7 +1504,7 @@ index_innerjoin(Query *root, RelOptInfo *rel, IndexOptInfo *index, RestrictInfo *clause = (RestrictInfo *) lfirst(temp); indexquals = lappend(indexquals, clause->clause); - if (! clause->isjoinqual) + if (clause->ispusheddown) alljoinquals = false; } @@ -1516,8 +1516,8 @@ index_innerjoin(Query *root, RelOptInfo *rel, IndexOptInfo *index, * therefore, both indexid and indexqual should be single-element * lists. */ - pathnode->indexid = lconsi(index->indexoid, NIL); - pathnode->indexqual = lcons(indexquals, NIL); + pathnode->indexid = makeListi1(index->indexoid); + pathnode->indexqual = makeList1(indexquals); /* We don't actually care what order the index scans in ... */ pathnode->indexscandir = NoMovementScanDirection; @@ -1541,7 +1541,7 @@ index_innerjoin(Query *root, RelOptInfo *rel, IndexOptInfo *index, */ pathnode->rows = rel->tuples * restrictlist_selectivity(root, - LispUnion(rel->baserestrictinfo, + set_union(rel->baserestrictinfo, clausegroup), lfirsti(rel->relids)); /* Like costsize.c, force estimate to be at least one row */ @@ -2034,7 +2034,7 @@ prefix_quals(Var *leftop, Oid expr_op, con = string_to_const(prefix, datatype); op = makeOper(oproid, InvalidOid, BOOLOID); expr = make_opclause(op, leftop, (Var *) con); - result = lcons(expr, NIL); + result = makeList1(expr); return result; } @@ -2049,7 +2049,7 @@ prefix_quals(Var *leftop, Oid expr_op, con = string_to_const(prefix, datatype); op = makeOper(oproid, InvalidOid, BOOLOID); expr = make_opclause(op, leftop, (Var *) con); - result = lcons(expr, NIL); + result = makeList1(expr); /* * If we can create a string larger than the prefix, say "x < |