mirror of
https://github.com/postgres/postgres.git
synced 2025-06-27 23:21:58 +03:00
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!
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.56 2000/09/12 21:06:53 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.57 2000/09/29 18:21:32 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -643,10 +643,10 @@ hash_inner_and_outer(Query *root,
|
||||
continue; /* not hashjoinable */
|
||||
|
||||
/*
|
||||
* If processing an outer join, only use explicit join clauses for
|
||||
* If processing an outer join, only use its own join clauses for
|
||||
* hashing. For inner joins we need not be so picky.
|
||||
*/
|
||||
if (isouterjoin && !restrictinfo->isjoinqual)
|
||||
if (isouterjoin && restrictinfo->ispusheddown)
|
||||
continue;
|
||||
|
||||
clause = restrictinfo->clause;
|
||||
@ -665,7 +665,7 @@ hash_inner_and_outer(Query *root,
|
||||
continue; /* no good for these input relations */
|
||||
|
||||
/* always a one-element list of hash clauses */
|
||||
hashclauses = lcons(restrictinfo, NIL);
|
||||
hashclauses = makeList1(restrictinfo);
|
||||
|
||||
/* estimate disbursion of inner var for costing purposes */
|
||||
innerdisbursion = estimate_disbursion(root, inner);
|
||||
@ -820,7 +820,7 @@ select_mergejoin_clauses(RelOptInfo *joinrel,
|
||||
*right;
|
||||
|
||||
/*
|
||||
* If processing an outer join, only use explicit join clauses in the
|
||||
* If processing an outer join, only use its own join clauses in the
|
||||
* merge. For inner joins we need not be so picky.
|
||||
*
|
||||
* Furthermore, if it is a right/full join then *all* the explicit
|
||||
@ -832,7 +832,7 @@ select_mergejoin_clauses(RelOptInfo *joinrel,
|
||||
*/
|
||||
if (isouterjoin)
|
||||
{
|
||||
if (!restrictinfo->isjoinqual)
|
||||
if (restrictinfo->ispusheddown)
|
||||
continue;
|
||||
switch (jointype)
|
||||
{
|
||||
|
Reference in New Issue
Block a user