summaryrefslogtreecommitdiffstats
path: root/src/include/optimizer/tlist.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:44:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:44:03 +0000
commit293913568e6a7a86fd1479e1cff8e2ecb58d6568 (patch)
treefc3b469a3ec5ab71b36ea97cc7aaddb838423a0c /src/include/optimizer/tlist.h
parentInitial commit. (diff)
downloadpostgresql-16-293913568e6a7a86fd1479e1cff8e2ecb58d6568.tar.xz
postgresql-16-293913568e6a7a86fd1479e1cff8e2ecb58d6568.zip
Adding upstream version 16.2.upstream/16.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/include/optimizer/tlist.h')
-rw-r--r--src/include/optimizer/tlist.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/include/optimizer/tlist.h b/src/include/optimizer/tlist.h
new file mode 100644
index 0000000..ca64309
--- /dev/null
+++ b/src/include/optimizer/tlist.h
@@ -0,0 +1,56 @@
+/*-------------------------------------------------------------------------
+ *
+ * tlist.h
+ * prototypes for tlist.c.
+ *
+ *
+ * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/optimizer/tlist.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef TLIST_H
+#define TLIST_H
+
+#include "nodes/pathnodes.h"
+
+
+extern TargetEntry *tlist_member(Expr *node, List *targetlist);
+
+extern List *add_to_flat_tlist(List *tlist, List *exprs);
+
+extern List *get_tlist_exprs(List *tlist, bool includeJunk);
+
+extern bool tlist_same_exprs(List *tlist1, List *tlist2);
+
+extern bool tlist_same_datatypes(List *tlist, List *colTypes, bool junkOK);
+extern bool tlist_same_collations(List *tlist, List *colCollations, bool junkOK);
+
+extern void apply_tlist_labeling(List *dest_tlist, List *src_tlist);
+
+extern Oid *extract_grouping_ops(List *groupClause);
+extern Oid *extract_grouping_collations(List *groupClause, List *tlist);
+extern AttrNumber *extract_grouping_cols(List *groupClause, List *tlist);
+extern bool grouping_is_sortable(List *groupClause);
+extern bool grouping_is_hashable(List *groupClause);
+
+extern PathTarget *make_pathtarget_from_tlist(List *tlist);
+extern List *make_tlist_from_pathtarget(PathTarget *target);
+extern PathTarget *copy_pathtarget(PathTarget *src);
+extern PathTarget *create_empty_pathtarget(void);
+extern void add_column_to_pathtarget(PathTarget *target,
+ Expr *expr, Index sortgroupref);
+extern void add_new_column_to_pathtarget(PathTarget *target, Expr *expr);
+extern void add_new_columns_to_pathtarget(PathTarget *target, List *exprs);
+extern void apply_pathtarget_labeling_to_tlist(List *tlist, PathTarget *target);
+extern void split_pathtarget_at_srfs(PlannerInfo *root,
+ PathTarget *target, PathTarget *input_target,
+ List **targets, List **targets_contain_srfs);
+
+/* Convenience macro to get a PathTarget with valid cost/width fields */
+#define create_pathtarget(root, tlist) \
+ set_pathtarget_cost_width(root, make_pathtarget_from_tlist(tlist))
+
+#endif /* TLIST_H */