mirror of
https://github.com/postgres/postgres.git
synced 2025-10-27 00:12:01 +03:00
Clean up optimizer's handling of indexscan quals that need to be
commuted (ie, the index var appears on the right). These are now handled the same way as merge and hash join quals that need to be commuted: the actual reversing of the clause only happens if we actually choose the path and generate a plan from it. Furthermore, the clause is only reversed in the 'indexqual' field of the plan, not in the 'indxqualorig' field. This allows the clause to still be recognized and removed from qpquals of upper level join plans. Also, simplify and generalize match_clause_to_indexkey; now it recognizes binary-compatible indexes for join as well as restriction clauses.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: clauses.h,v 1.26 1999/08/10 03:00:12 tgl Exp $
|
||||
* $Id: clauses.h,v 1.27 1999/08/12 04:32:49 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -47,7 +47,7 @@ extern void get_relattval(Node *clause, int targetrelid,
|
||||
Datum *constval, int *flag);
|
||||
extern void get_rels_atts(Node *clause, int *relid1,
|
||||
AttrNumber *attno1, int *relid2, AttrNumber *attno2);
|
||||
extern void CommuteClause(Node *clause);
|
||||
extern void CommuteClause(Expr *clause);
|
||||
|
||||
extern bool expression_tree_walker(Node *node, bool (*walker) (),
|
||||
void *context);
|
||||
|
||||
Reference in New Issue
Block a user