mirror of
https://github.com/postgres/postgres.git
synced 2025-10-27 00:12:01 +03:00
First cut at full support for OUTER JOINs. There are still a few loose
ends to clean up (see my message of same date to pghackers), but mostly it works. INITDB REQUIRED!
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: clauses.h,v 1.38 2000/08/13 02:50:26 tgl Exp $
|
||||
* $Id: clauses.h,v 1.39 2000/09/12 21:07:11 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -73,9 +73,11 @@ extern void CommuteClause(Expr *clause);
|
||||
extern Node *eval_const_expressions(Node *node);
|
||||
|
||||
extern bool expression_tree_walker(Node *node, bool (*walker) (),
|
||||
void *context);
|
||||
void *context);
|
||||
extern Node *expression_tree_mutator(Node *node, Node *(*mutator) (),
|
||||
void *context);
|
||||
void *context);
|
||||
extern bool query_tree_walker(Query *query, bool (*walker) (),
|
||||
void *context);
|
||||
|
||||
#define is_subplan(clause) ((clause) != NULL && \
|
||||
IsA(clause, Expr) && \
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: pathnode.h,v 1.27 2000/04/12 17:16:42 momjian Exp $
|
||||
* $Id: pathnode.h,v 1.28 2000/09/12 21:07:11 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -34,26 +34,29 @@ extern IndexPath *create_index_path(Query *root, RelOptInfo *rel,
|
||||
extern TidPath *create_tidscan_path(RelOptInfo *rel, List *tideval);
|
||||
|
||||
extern NestPath *create_nestloop_path(RelOptInfo *joinrel,
|
||||
Path *outer_path,
|
||||
Path *inner_path,
|
||||
List *restrict_clauses,
|
||||
List *pathkeys);
|
||||
JoinType jointype,
|
||||
Path *outer_path,
|
||||
Path *inner_path,
|
||||
List *restrict_clauses,
|
||||
List *pathkeys);
|
||||
|
||||
extern MergePath *create_mergejoin_path(RelOptInfo *joinrel,
|
||||
Path *outer_path,
|
||||
Path *inner_path,
|
||||
List *restrict_clauses,
|
||||
List *pathkeys,
|
||||
List *mergeclauses,
|
||||
List *outersortkeys,
|
||||
List *innersortkeys);
|
||||
JoinType jointype,
|
||||
Path *outer_path,
|
||||
Path *inner_path,
|
||||
List *restrict_clauses,
|
||||
List *pathkeys,
|
||||
List *mergeclauses,
|
||||
List *outersortkeys,
|
||||
List *innersortkeys);
|
||||
|
||||
extern HashPath *create_hashjoin_path(RelOptInfo *joinrel,
|
||||
Path *outer_path,
|
||||
Path *inner_path,
|
||||
List *restrict_clauses,
|
||||
List *hashclauses,
|
||||
Selectivity innerdisbursion);
|
||||
JoinType jointype,
|
||||
Path *outer_path,
|
||||
Path *inner_path,
|
||||
List *restrict_clauses,
|
||||
List *hashclauses,
|
||||
Selectivity innerdisbursion);
|
||||
|
||||
/*
|
||||
* prototypes for relnode.c
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: paths.h,v 1.46 2000/07/24 03:10:54 tgl Exp $
|
||||
* $Id: paths.h,v 1.47 2000/09/12 21:07:11 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -61,21 +61,23 @@ extern void create_tidscan_paths(Query *root, RelOptInfo *rel);
|
||||
* routines to create join paths
|
||||
*/
|
||||
extern void add_paths_to_joinrel(Query *root, RelOptInfo *joinrel,
|
||||
RelOptInfo *outerrel,
|
||||
RelOptInfo *innerrel,
|
||||
List *restrictlist);
|
||||
RelOptInfo *outerrel,
|
||||
RelOptInfo *innerrel,
|
||||
JoinType jointype,
|
||||
List *restrictlist);
|
||||
|
||||
/*
|
||||
* joinrels.c
|
||||
* routines to determine which relations to join
|
||||
*/
|
||||
extern void make_rels_by_joins(Query *root, int level);
|
||||
extern RelOptInfo *make_rels_by_clause_joins(Query *root,
|
||||
RelOptInfo *old_rel,
|
||||
List *other_rels);
|
||||
extern RelOptInfo *make_rels_by_clauseless_joins(Query *root,
|
||||
RelOptInfo *old_rel,
|
||||
List *other_rels);
|
||||
extern List *make_rels_by_joins(Query *root, int level, List **joinrels);
|
||||
extern List *make_rels_by_clause_joins(Query *root,
|
||||
RelOptInfo *old_rel,
|
||||
List *other_rels);
|
||||
extern List *make_rels_by_clauseless_joins(Query *root,
|
||||
RelOptInfo *old_rel,
|
||||
List *other_rels);
|
||||
extern RelOptInfo *make_rel_from_jointree(Query *root, Node *jtnode);
|
||||
|
||||
/*
|
||||
* pathkeys.c
|
||||
@@ -110,7 +112,7 @@ extern List *make_pathkeys_for_sortclauses(List *sortclauses,
|
||||
extern List *find_mergeclauses_for_pathkeys(List *pathkeys,
|
||||
List *restrictinfos);
|
||||
extern List *make_pathkeys_for_mergeclauses(Query *root,
|
||||
List *mergeclauses,
|
||||
List *tlist);
|
||||
List *mergeclauses,
|
||||
RelOptInfo *rel);
|
||||
|
||||
#endif /* PATHS_H */
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: planmain.h,v 1.43 2000/07/24 03:10:54 tgl Exp $
|
||||
* $Id: planmain.h,v 1.44 2000/09/12 21:07:11 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -20,8 +20,7 @@
|
||||
/*
|
||||
* prototypes for plan/planmain.c
|
||||
*/
|
||||
extern Plan *query_planner(Query *root, List *tlist, List *qual,
|
||||
double tuple_fraction);
|
||||
extern Plan *query_planner(Query *root, List *tlist, double tuple_fraction);
|
||||
|
||||
/*
|
||||
* prototypes for plan/createplan.c
|
||||
@@ -40,9 +39,10 @@ extern Result *make_result(List *tlist, Node *resconstantqual, Plan *subplan);
|
||||
/*
|
||||
* prototypes for plan/initsplan.c
|
||||
*/
|
||||
extern void make_var_only_tlist(Query *root, List *tlist);
|
||||
extern void build_base_rel_tlists(Query *root, List *tlist);
|
||||
extern Relids add_join_quals_to_rels(Query *root, Node *jtnode);
|
||||
extern void add_restrict_and_join_to_rels(Query *root, List *clauses);
|
||||
extern void add_missing_rels_to_query(Query *root);
|
||||
extern List *add_missing_rels_to_query(Query *root, Node *jtnode);
|
||||
extern void process_implied_equality(Query *root, Node *item1, Node *item2,
|
||||
Oid sortop1, Oid sortop2);
|
||||
|
||||
@@ -58,6 +58,7 @@ extern void fix_opids(Node *node);
|
||||
* prep/prepkeyset.c
|
||||
*/
|
||||
extern bool _use_keyset_query_optimizer;
|
||||
|
||||
extern void transformKeySetQuery(Query *origNode);
|
||||
|
||||
#endif /* PLANMAIN_H */
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: restrictinfo.h,v 1.8 2000/01/26 05:58:21 momjian Exp $
|
||||
* $Id: restrictinfo.h,v 1.9 2000/09/12 21:07:11 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -18,5 +18,7 @@
|
||||
|
||||
extern bool restriction_is_or_clause(RestrictInfo *restrictinfo);
|
||||
extern List *get_actual_clauses(List *restrictinfo_list);
|
||||
extern void get_actual_join_clauses(List *restrictinfo_list,
|
||||
List **joinquals, List **otherquals);
|
||||
|
||||
#endif /* RESTRICTINFO_H */
|
||||
|
||||
Reference in New Issue
Block a user