mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-05 11:27:34 +08:00
There are some unimplemented aspects: recursive queries must use UNION ALL (should allow UNION too), and we don't have SEARCH or CYCLE clauses. These might or might not get done for 8.4, but even without them it's a pretty useful feature. There are also a couple of small loose ends and definitional quibbles, which I'll send a memo about to pgsql-hackers shortly. But let's land the patch now so we can get on with other development. Yoshiyuki Asaba, with lots of help from Tatsuo Ishii and Tom Lane
105 lines
3.5 KiB
C
105 lines
3.5 KiB
C
/*-------------------------------------------------------------------------
|
|
*
|
|
* pathnode.h
|
|
* prototypes for pathnode.c, relnode.c.
|
|
*
|
|
*
|
|
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
|
*
|
|
* $PostgreSQL: pgsql/src/include/optimizer/pathnode.h,v 1.79 2008/10/04 21:56:55 tgl Exp $
|
|
*
|
|
*-------------------------------------------------------------------------
|
|
*/
|
|
#ifndef PATHNODE_H
|
|
#define PATHNODE_H
|
|
|
|
#include "nodes/relation.h"
|
|
|
|
|
|
/*
|
|
* prototypes for pathnode.c
|
|
*/
|
|
extern int compare_path_costs(Path *path1, Path *path2,
|
|
CostSelector criterion);
|
|
extern int compare_fractional_path_costs(Path *path1, Path *path2,
|
|
double fraction);
|
|
extern void set_cheapest(RelOptInfo *parent_rel);
|
|
extern void add_path(RelOptInfo *parent_rel, Path *new_path);
|
|
|
|
extern Path *create_seqscan_path(PlannerInfo *root, RelOptInfo *rel);
|
|
extern IndexPath *create_index_path(PlannerInfo *root,
|
|
IndexOptInfo *index,
|
|
List *clause_groups,
|
|
List *pathkeys,
|
|
ScanDirection indexscandir,
|
|
RelOptInfo *outer_rel);
|
|
extern BitmapHeapPath *create_bitmap_heap_path(PlannerInfo *root,
|
|
RelOptInfo *rel,
|
|
Path *bitmapqual,
|
|
RelOptInfo *outer_rel);
|
|
extern BitmapAndPath *create_bitmap_and_path(PlannerInfo *root,
|
|
RelOptInfo *rel,
|
|
List *bitmapquals);
|
|
extern BitmapOrPath *create_bitmap_or_path(PlannerInfo *root,
|
|
RelOptInfo *rel,
|
|
List *bitmapquals);
|
|
extern TidPath *create_tidscan_path(PlannerInfo *root, RelOptInfo *rel,
|
|
List *tidquals);
|
|
extern AppendPath *create_append_path(RelOptInfo *rel, List *subpaths);
|
|
extern ResultPath *create_result_path(List *quals);
|
|
extern MaterialPath *create_material_path(RelOptInfo *rel, Path *subpath);
|
|
extern UniquePath *create_unique_path(PlannerInfo *root, RelOptInfo *rel,
|
|
Path *subpath, SpecialJoinInfo *sjinfo);
|
|
extern Path *create_subqueryscan_path(RelOptInfo *rel, List *pathkeys);
|
|
extern Path *create_functionscan_path(PlannerInfo *root, RelOptInfo *rel);
|
|
extern Path *create_valuesscan_path(PlannerInfo *root, RelOptInfo *rel);
|
|
extern Path *create_ctescan_path(PlannerInfo *root, RelOptInfo *rel);
|
|
extern Path *create_worktablescan_path(PlannerInfo *root, RelOptInfo *rel);
|
|
|
|
extern NestPath *create_nestloop_path(PlannerInfo *root,
|
|
RelOptInfo *joinrel,
|
|
JoinType jointype,
|
|
SpecialJoinInfo *sjinfo,
|
|
Path *outer_path,
|
|
Path *inner_path,
|
|
List *restrict_clauses,
|
|
List *pathkeys);
|
|
|
|
extern MergePath *create_mergejoin_path(PlannerInfo *root,
|
|
RelOptInfo *joinrel,
|
|
JoinType jointype,
|
|
SpecialJoinInfo *sjinfo,
|
|
Path *outer_path,
|
|
Path *inner_path,
|
|
List *restrict_clauses,
|
|
List *pathkeys,
|
|
List *mergeclauses,
|
|
List *outersortkeys,
|
|
List *innersortkeys);
|
|
|
|
extern HashPath *create_hashjoin_path(PlannerInfo *root,
|
|
RelOptInfo *joinrel,
|
|
JoinType jointype,
|
|
SpecialJoinInfo *sjinfo,
|
|
Path *outer_path,
|
|
Path *inner_path,
|
|
List *restrict_clauses,
|
|
List *hashclauses);
|
|
|
|
/*
|
|
* prototypes for relnode.c
|
|
*/
|
|
extern RelOptInfo *build_simple_rel(PlannerInfo *root, int relid,
|
|
RelOptKind reloptkind);
|
|
extern RelOptInfo *find_base_rel(PlannerInfo *root, int relid);
|
|
extern RelOptInfo *find_join_rel(PlannerInfo *root, Relids relids);
|
|
extern RelOptInfo *build_join_rel(PlannerInfo *root,
|
|
Relids joinrelids,
|
|
RelOptInfo *outer_rel,
|
|
RelOptInfo *inner_rel,
|
|
SpecialJoinInfo *sjinfo,
|
|
List **restrictlist_ptr);
|
|
|
|
#endif /* PATHNODE_H */
|