1 /*-------------------------------------------------------------------------
4 * prototypes for plancat.c.
7 * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
10 * src/include/optimizer/plancat.h
12 *-------------------------------------------------------------------------
17 #include "nodes/pathnodes.h"
18 #include "utils/relcache.h"
20 /* Hook for plugins to get control in get_relation_info() */
21 typedef void (*get_relation_info_hook_type
) (PlannerInfo
*root
,
25 extern PGDLLIMPORT get_relation_info_hook_type get_relation_info_hook
;
28 extern void get_relation_info(PlannerInfo
*root
, Oid relationObjectId
,
29 bool inhparent
, RelOptInfo
*rel
);
31 extern List
*infer_arbiter_indexes(PlannerInfo
*root
);
33 extern void estimate_rel_size(Relation rel
, int32
*attr_widths
,
34 BlockNumber
*pages
, double *tuples
, double *allvisfrac
);
36 extern int32
get_rel_data_width(Relation rel
, int32
*attr_widths
);
37 extern int32
get_relation_data_width(Oid relid
, int32
*attr_widths
);
39 extern bool relation_excluded_by_constraints(PlannerInfo
*root
,
40 RelOptInfo
*rel
, RangeTblEntry
*rte
);
42 extern List
*build_physical_tlist(PlannerInfo
*root
, RelOptInfo
*rel
);
44 extern bool has_unique_index(RelOptInfo
*rel
, AttrNumber attno
);
46 extern Selectivity
restriction_selectivity(PlannerInfo
*root
,
52 extern Selectivity
join_selectivity(PlannerInfo
*root
,
57 SpecialJoinInfo
*sjinfo
);
59 extern Selectivity
function_selectivity(PlannerInfo
*root
,
66 SpecialJoinInfo
*sjinfo
);
68 extern void add_function_cost(PlannerInfo
*root
, Oid funcid
, Node
*node
,
71 extern double get_function_rows(PlannerInfo
*root
, Oid funcid
, Node
*node
);
73 extern bool has_row_triggers(PlannerInfo
*root
, Index rti
, CmdType event
);
75 extern bool has_stored_generated_columns(PlannerInfo
*root
, Index rti
);
77 #endif /* PLANCAT_H */