mirror of
https://github.com/postgres/postgres.git
synced 2025-06-14 18:42:34 +03:00
Adjust subquery qual pushdown rules to be more forgiving: if a qual
refers to a non-DISTINCT output column of a DISTINCT ON subquery, or if it refers to a function-returning-set, we cannot push it down. But the old implementation refused to push down *any* quals if the subquery had any such 'dangerous' outputs. Now we just look at the output columns actually referenced by each qual expression. More code than before, but probably no slower since we don't make unnecessary checks.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.111 2003/03/10 03:53:51 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.112 2003/03/22 01:49:38 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -60,7 +60,6 @@ static TargetEntry *findTargetlistEntry(ParseState *pstate, Node *node,
|
||||
List *tlist, int clause);
|
||||
static List *addTargetToSortList(TargetEntry *tle, List *sortlist,
|
||||
List *targetlist, List *opname);
|
||||
static bool targetIsInSortList(TargetEntry *tle, List *sortList);
|
||||
|
||||
|
||||
/*
|
||||
@ -1386,7 +1385,7 @@ assignSortGroupRef(TargetEntry *tle, List *tlist)
|
||||
* reason we need this routine (and not just a quick test for nonzeroness
|
||||
* of ressortgroupref) is that a TLE might be in only one of the lists.
|
||||
*/
|
||||
static bool
|
||||
bool
|
||||
targetIsInSortList(TargetEntry *tle, List *sortList)
|
||||
{
|
||||
Index ref = tle->resdom->ressortgroupref;
|
||||
|
Reference in New Issue
Block a user