postgresql/src/include/optimizer/paths.h

102 lines
3.0 KiB
C
Raw Normal View History

/*-------------------------------------------------------------------------
*
* paths.h
* prototypes for various files in optimizer/path (were separate
* header files)
*
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: paths.h,v 1.37 2000/01/09 00:26:47 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef PATHS_H
#define PATHS_H
1997-11-26 02:14:33 +01:00
#include "nodes/relation.h"
/*
* allpaths.c
*/
extern RelOptInfo *make_one_rel(Query *root, List *rels);
/*
* indxpath.c
* routines to generate index paths
*/
1999-05-26 00:43:53 +02:00
extern List *create_index_paths(Query *root, RelOptInfo *rel, List *indices,
1999-05-25 18:15:34 +02:00
List *restrictinfo_list,
List *joininfo_list);
extern Oid indexable_operator(Expr *clause, Oid opclass, Oid relam,
bool indexkey_on_left);
extern List *expand_indexqual_conditions(List *indexquals);
/*
* tidpath.h
* routines to generate tid paths
*/
extern List *create_tidscan_paths(Query *root, RelOptInfo *rel);
/*
* joinpath.c
* routines to create join paths
*/
1999-02-14 05:57:02 +01:00
extern void update_rels_pathlist_for_joins(Query *root, List *joinrels);
/*
* orindxpath.c
*/
1999-05-26 00:43:53 +02:00
extern List *create_or_index_paths(Query *root, RelOptInfo *rel, List *clauses);
/*
* pathkeys.c
* utilities for matching and building path keys
*/
typedef enum
{
PATHKEYS_EQUAL, /* pathkeys are identical */
PATHKEYS_BETTER1, /* pathkey 1 is a superset of pathkey 2 */
PATHKEYS_BETTER2, /* vice versa */
PATHKEYS_DIFFERENT /* neither pathkey includes the other */
} PathKeysComparison;
extern PathKeysComparison compare_pathkeys(List *keys1, List *keys2);
extern bool pathkeys_contained_in(List *keys1, List *keys2);
extern Path *get_cheapest_path_for_pathkeys(List *paths, List *pathkeys,
bool indexpaths_only);
extern List *build_index_pathkeys(Query *root, RelOptInfo *rel,
IndexOptInfo *index);
extern List *build_join_pathkeys(List *outer_pathkeys,
List *join_rel_tlist, List *joinclauses);
extern bool commute_pathkeys(List *pathkeys);
extern List *make_pathkeys_for_sortclauses(List *sortclauses,
List *tlist);
extern List *find_mergeclauses_for_pathkeys(List *pathkeys,
List *restrictinfos);
extern List *make_pathkeys_for_mergeclauses(List *mergeclauses,
List *tlist);
/*
* joinrels.c
* routines to determine which relations to join
*/
1999-02-18 05:45:36 +01:00
extern List *make_rels_by_joins(Query *root, List *old_rels);
1999-05-26 00:43:53 +02:00
extern List *make_rels_by_clause_joins(Query *root, RelOptInfo *old_rel,
1999-05-25 18:15:34 +02:00
List *joininfo_list, Relids only_relids);
1999-05-26 00:43:53 +02:00
extern List *make_rels_by_clauseless_joins(RelOptInfo *old_rel,
1999-05-25 18:15:34 +02:00
List *inner_rels);
extern RelOptInfo *get_cheapest_complete_rel(List *join_rel_list);
extern bool nonoverlap_sets(List *s1, List *s2);
extern bool is_subset(List *s1, List *s2);
/*
* prototypes for path/prune.c
*/
1999-02-14 05:57:02 +01:00
extern void merge_rels_with_same_relids(List *rel_list);
extern void rels_set_cheapest(Query *root, List *rel_list);
extern List *del_rels_all_bushy_inactive(List *old_rels);
#endif /* PATHS_H */