1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-27 00:12:01 +03:00

Phase 2 of read-only-plans project: restructure expression-tree nodes

so that all executable expression nodes inherit from a common supertype
Expr.  This is somewhat of an exercise in code purity rather than any
real functional advance, but getting rid of the extra Oper or Func node
formerly used in each operator or function call should provide at least
a little space and speed improvement.
initdb forced by changes in stored-rules representation.
This commit is contained in:
Tom Lane
2002-12-12 15:49:42 +00:00
parent debb072886
commit a0bf885f9e
69 changed files with 3390 additions and 3433 deletions

View File

@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: clauses.h,v 1.56 2002/12/01 21:05:14 tgl Exp $
* $Id: clauses.h,v 1.57 2002/12/12 15:49:41 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -16,23 +16,28 @@
#include "nodes/relation.h"
extern Expr *make_clause(int type, Node *oper, List *args);
extern bool is_opclause(Node *clause);
extern Expr *make_opclause(Oper *op, Var *leftop, Var *rightop);
#define is_opclause(clause) ((clause) != NULL && IsA(clause, OpExpr))
#define is_funcclause(clause) ((clause) != NULL && IsA(clause, FuncExpr))
#define is_subplan(clause) ((clause) != NULL && IsA(clause, SubPlanExpr))
extern Expr *make_opclause(Oid opno, Oid opresulttype, bool opretset,
Expr *leftop, Expr *rightop);
extern Var *get_leftop(Expr *clause);
extern Var *get_rightop(Expr *clause);
extern bool is_funcclause(Node *clause);
extern Expr *make_funcclause(Func *func, List *funcargs);
extern bool or_clause(Node *clause);
extern Expr *make_orclause(List *orclauses);
extern Expr *make_funcclause(Oid funcid, Oid funcresulttype, bool funcretset,
CoercionForm funcformat, List *funcargs);
extern bool not_clause(Node *clause);
extern Expr *make_notclause(Expr *notclause);
extern Expr *get_notclausearg(Expr *notclause);
extern bool or_clause(Node *clause);
extern Expr *make_orclause(List *orclauses);
extern bool and_clause(Node *clause);
extern Expr *make_andclause(List *andclauses);
extern Node *make_and_qual(Node *qual1, Node *qual2);
@@ -60,7 +65,7 @@ extern bool has_distinct_on_clause(Query *query);
extern void clause_get_relids_vars(Node *clause, Relids *relids, List **vars);
extern int NumRelids(Node *clause);
extern void CommuteClause(Expr *clause);
extern void CommuteClause(OpExpr *clause);
extern Node *eval_const_expressions(Node *node);
@@ -78,8 +83,4 @@ extern bool query_tree_walker(Query *query, bool (*walker) (),
extern void query_tree_mutator(Query *query, Node *(*mutator) (),
void *context, int flags);
#define is_subplan(clause) ((clause) != NULL && \
IsA(clause, Expr) && \
((Expr *) (clause))->opType == SUBPLAN_EXPR)
#endif /* CLAUSES_H */

View File

@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: paths.h,v 1.61 2002/11/24 21:52:15 tgl Exp $
* $Id: paths.h,v 1.62 2002/12/12 15:49:41 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -42,8 +42,6 @@ extern void debug_print_rel(Query *root, RelOptInfo *rel);
extern void create_index_paths(Query *root, RelOptInfo *rel);
extern Path *best_inner_indexscan(Query *root, RelOptInfo *rel,
Relids outer_relids, JoinType jointype);
extern Oid indexable_operator(Expr *clause, Oid opclass,
bool indexkey_on_left);
extern List *extract_or_indexqual_conditions(RelOptInfo *rel,
IndexOptInfo *index,
Expr *orsubclause);

View File

@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: planmain.h,v 1.63 2002/11/21 00:42:19 tgl Exp $
* $Id: planmain.h,v 1.64 2002/12/12 15:49:41 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -68,6 +68,6 @@ extern void set_plan_references(Plan *plan, List *rtable);
extern List *join_references(List *clauses, List *rtable,
List *outer_tlist, List *inner_tlist,
Index acceptable_rel);
extern void fix_opids(Node *node);
extern void fix_opfuncids(Node *node);
#endif /* PLANMAIN_H */