PostgreSQL Source Code  git master
tlist.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * tlist.h
4  * prototypes for tlist.c.
5  *
6  *
7  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/optimizer/tlist.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef TLIST_H
15 #define TLIST_H
16 
17 #include "nodes/relation.h"
18 
19 
20 extern TargetEntry *tlist_member(Expr *node, List *targetlist);
21 extern TargetEntry *tlist_member_ignore_relabel(Expr *node, List *targetlist);
22 
23 extern List *add_to_flat_tlist(List *tlist, List *exprs);
24 
25 extern List *get_tlist_exprs(List *tlist, bool includeJunk);
26 
27 extern int count_nonjunk_tlist_entries(List *tlist);
28 
29 extern bool tlist_same_exprs(List *tlist1, List *tlist2);
30 
31 extern bool tlist_same_datatypes(List *tlist, List *colTypes, bool junkOK);
32 extern bool tlist_same_collations(List *tlist, List *colCollations, bool junkOK);
33 
34 extern void apply_tlist_labeling(List *dest_tlist, List *src_tlist);
35 
36 extern TargetEntry *get_sortgroupref_tle(Index sortref,
37  List *targetList);
39  List *targetList);
41  List *targetList);
42 extern List *get_sortgrouplist_exprs(List *sgClauses,
43  List *targetList);
44 
46  List *clauses);
48  List *clauses);
49 
50 extern Oid *extract_grouping_ops(List *groupClause);
51 extern AttrNumber *extract_grouping_cols(List *groupClause, List *tlist);
52 extern bool grouping_is_sortable(List *groupClause);
53 extern bool grouping_is_hashable(List *groupClause);
54 
59 extern void add_column_to_pathtarget(PathTarget *target,
60  Expr *expr, Index sortgroupref);
61 extern void add_new_column_to_pathtarget(PathTarget *target, Expr *expr);
62 extern void add_new_columns_to_pathtarget(PathTarget *target, List *exprs);
63 extern void apply_pathtarget_labeling_to_tlist(List *tlist, PathTarget *target);
64 extern void split_pathtarget_at_srfs(PlannerInfo *root,
65  PathTarget *target, PathTarget *input_target,
66  List **targets, List **targets_contain_srfs);
67 
68 /* Convenience macro to get a PathTarget with valid cost/width fields */
69 #define create_pathtarget(root, tlist) \
70  set_pathtarget_cost_width(root, make_pathtarget_from_tlist(tlist))
71 
72 #endif /* TLIST_H */
bool grouping_is_hashable(List *groupClause)
Definition: tlist.c:538
SortGroupClause * get_sortgroupref_clause_noerr(Index sortref, List *clauses)
Definition: tlist.c:446
List * get_tlist_exprs(List *tlist, bool includeJunk)
Definition: tlist.c:166
AttrNumber * extract_grouping_cols(List *groupClause, List *tlist)
Definition: tlist.c:492
bool grouping_is_sortable(List *groupClause)
Definition: tlist.c:518
void add_new_column_to_pathtarget(PathTarget *target, Expr *expr)
Definition: tlist.c:703
Definition: nodes.h:512
void add_new_columns_to_pathtarget(PathTarget *target, List *exprs)
Definition: tlist.c:714
TargetEntry * tlist_member(Expr *node, List *targetlist)
Definition: tlist.c:54
unsigned int Oid
Definition: postgres_ext.h:31
TargetEntry * get_sortgroupclause_tle(SortGroupClause *sgClause, List *targetList)
Definition: tlist.c:370
bool tlist_same_collations(List *tlist, List *colCollations, bool junkOK)
Definition: tlist.c:285
PathTarget * make_pathtarget_from_tlist(List *tlist)
Definition: tlist.c:569
void apply_pathtarget_labeling_to_tlist(List *tlist, PathTarget *target)
Definition: tlist.c:736
void apply_tlist_labeling(List *dest_tlist, List *src_tlist)
Definition: tlist.c:321
List * make_tlist_from_pathtarget(PathTarget *target)
Definition: tlist.c:595
int count_nonjunk_tlist_entries(List *tlist)
Definition: tlist.c:189
bool tlist_same_datatypes(List *tlist, List *colTypes, bool junkOK)
Definition: tlist.c:251
Oid * extract_grouping_ops(List *groupClause)
Definition: tlist.c:466
List * get_sortgrouplist_exprs(List *sgClauses, List *targetList)
Definition: tlist.c:395
bool tlist_same_exprs(List *tlist1, List *tlist2)
Definition: tlist.c:221
SortGroupClause * get_sortgroupref_clause(Index sortref, List *clauses)
Definition: tlist.c:425
PathTarget * create_empty_pathtarget(void)
Definition: tlist.c:653
PathTarget * copy_pathtarget(PathTarget *src)
Definition: tlist.c:629
unsigned int Index
Definition: c.h:423
TargetEntry * tlist_member_ignore_relabel(Expr *node, List *targetlist)
Definition: tlist.c:75
TargetEntry * get_sortgroupref_tle(Index sortref, List *targetList)
Definition: tlist.c:348
Node * get_sortgroupclause_expr(SortGroupClause *sgClause, List *targetList)
Definition: tlist.c:382
void add_column_to_pathtarget(PathTarget *target, Expr *expr, Index sortgroupref)
Definition: tlist.c:667
Definition: pg_list.h:45
List * add_to_flat_tlist(List *tlist, List *exprs)
Definition: tlist.c:135
int16 AttrNumber
Definition: attnum.h:21
void split_pathtarget_at_srfs(PlannerInfo *root, PathTarget *target, PathTarget *input_target, List **targets, List **targets_contain_srfs)
Definition: tlist.c:840