1/*-------------------------------------------------------------------------
2 *
3 * subselect.h
4 * Planning routines for subselects.
5 *
6 * Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
8 *
9 * src/include/optimizer/subselect.h
10 *
11 *-------------------------------------------------------------------------
12 */
13#ifndef SUBSELECT_H
14#define SUBSELECT_H
15
16#include "nodes/pathnodes.h"
17#include "nodes/plannodes.h"
18
19extern void SS_process_ctes(PlannerInfo *root);
20extern JoinExpr *convert_ANY_sublink_to_join(PlannerInfo *root,
21 SubLink *sublink,
22 Relids available_rels);
23extern JoinExpr *convert_EXISTS_sublink_to_join(PlannerInfo *root,
24 SubLink *sublink,
25 bool under_not,
26 Relids available_rels);
27extern Node *SS_replace_correlation_vars(PlannerInfo *root, Node *expr);
28extern Node *SS_process_sublinks(PlannerInfo *root, Node *expr, bool isQual);
29extern void SS_identify_outer_params(PlannerInfo *root);
30extern void SS_charge_for_initplans(PlannerInfo *root, RelOptInfo *final_rel);
31extern void SS_attach_initplans(PlannerInfo *root, Plan *plan);
32extern void SS_finalize_plan(PlannerInfo *root, Plan *plan);
33extern Param *SS_make_initplan_output_param(PlannerInfo *root,
34 Oid resulttype, int32 resulttypmod,
35 Oid resultcollation);
36extern void SS_make_initplan_from_plan(PlannerInfo *root,
37 PlannerInfo *subroot, Plan *plan,
38 Param *prm);
39
40#endif /* SUBSELECT_H */
41