PostgreSQL Source Code git master
plancat.h
Go to the documentation of this file.
1/*-------------------------------------------------------------------------
2 *
3 * plancat.h
4 * prototypes for plancat.c.
5 *
6 *
7 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
9 *
10 * src/include/optimizer/plancat.h
11 *
12 *-------------------------------------------------------------------------
13 */
14#ifndef PLANCAT_H
15#define PLANCAT_H
16
17#include "nodes/pathnodes.h"
18#include "utils/relcache.h"
19
20/* Hook for plugins to get control in get_relation_info() */
22 Oid relationObjectId,
23 bool inhparent,
24 RelOptInfo *rel);
26
27
28extern void get_relation_info(PlannerInfo *root, Oid relationObjectId,
29 bool inhparent, RelOptInfo *rel);
30
32
33extern void estimate_rel_size(Relation rel, int32 *attr_widths,
34 BlockNumber *pages, double *tuples, double *allvisfrac);
35
36extern int32 get_rel_data_width(Relation rel, int32 *attr_widths);
37extern int32 get_relation_data_width(Oid relid, int32 *attr_widths);
38
40 RelOptInfo *rel, RangeTblEntry *rte);
41
43
44extern bool has_unique_index(RelOptInfo *rel, AttrNumber attno);
45
47 Oid operatorid,
48 List *args,
49 Oid inputcollid,
50 int varRelid);
51
53 Oid operatorid,
54 List *args,
55 Oid inputcollid,
56 JoinType jointype,
57 SpecialJoinInfo *sjinfo);
58
60 Oid funcid,
61 List *args,
62 Oid inputcollid,
63 bool is_join,
64 int varRelid,
65 JoinType jointype,
66 SpecialJoinInfo *sjinfo);
67
68extern void add_function_cost(PlannerInfo *root, Oid funcid, Node *node,
69 QualCost *cost);
70
71extern double get_function_rows(PlannerInfo *root, Oid funcid, Node *node);
72
73extern bool has_row_triggers(PlannerInfo *root, Index rti, CmdType event);
74
76
78 Bitmapset *target_cols);
79
80#endif /* PLANCAT_H */
int16 AttrNumber
Definition: attnum.h:21
uint32 BlockNumber
Definition: block.h:31
#define PGDLLIMPORT
Definition: c.h:1291
int32_t int32
Definition: c.h:498
unsigned int Index
Definition: c.h:585
CmdType
Definition: nodes.h:265
double Selectivity
Definition: nodes.h:252
JoinType
Definition: nodes.h:290
void estimate_rel_size(Relation rel, int32 *attr_widths, BlockNumber *pages, double *tuples, double *allvisfrac)
Definition: plancat.c:1067
PGDLLIMPORT get_relation_info_hook_type get_relation_info_hook
Definition: plancat.c:60
void(* get_relation_info_hook_type)(PlannerInfo *root, Oid relationObjectId, bool inhparent, RelOptInfo *rel)
Definition: plancat.h:21
int32 get_rel_data_width(Relation rel, int32 *attr_widths)
Definition: plancat.c:1192
bool has_stored_generated_columns(PlannerInfo *root, Index rti)
Definition: plancat.c:2310
bool relation_excluded_by_constraints(PlannerInfo *root, RelOptInfo *rel, RangeTblEntry *rte)
Definition: plancat.c:1594
double get_function_rows(PlannerInfo *root, Oid funcid, Node *node)
Definition: plancat.c:2170
bool has_row_triggers(PlannerInfo *root, Index rti, CmdType event)
Definition: plancat.c:2260
void add_function_cost(PlannerInfo *root, Oid funcid, Node *node, QualCost *cost)
Definition: plancat.c:2109
List * build_physical_tlist(PlannerInfo *root, RelOptInfo *rel)
Definition: plancat.c:1784
Selectivity restriction_selectivity(PlannerInfo *root, Oid operatorid, List *args, Oid inputcollid, int varRelid)
Definition: plancat.c:1967
int32 get_relation_data_width(Oid relid, int32 *attr_widths)
Definition: plancat.c:1234
bool has_unique_index(RelOptInfo *rel, AttrNumber attno)
Definition: plancat.c:2228
Selectivity join_selectivity(PlannerInfo *root, Oid operatorid, List *args, Oid inputcollid, JoinType jointype, SpecialJoinInfo *sjinfo)
Definition: plancat.c:2006
Selectivity function_selectivity(PlannerInfo *root, Oid funcid, List *args, Oid inputcollid, bool is_join, int varRelid, JoinType jointype, SpecialJoinInfo *sjinfo)
Definition: plancat.c:2047
Bitmapset * get_dependent_generated_columns(PlannerInfo *root, Index rti, Bitmapset *target_cols)
Definition: plancat.c:2337
void get_relation_info(PlannerInfo *root, Oid relationObjectId, bool inhparent, RelOptInfo *rel)
Definition: plancat.c:116
List * infer_arbiter_indexes(PlannerInfo *root)
Definition: plancat.c:705
unsigned int Oid
Definition: postgres_ext.h:32
tree ctl root
Definition: radixtree.h:1857
Definition: pg_list.h:54
Definition: nodes.h:131