PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/htup_details.h"
#include "catalog/pg_language.h"
#include "catalog/pg_operator.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_type.h"
#include "executor/executor.h"
#include "executor/functions.h"
#include "funcapi.h"
#include "miscadmin.h"
#include "nodes/makefuncs.h"
#include "nodes/multibitmapset.h"
#include "nodes/nodeFuncs.h"
#include "nodes/subscripting.h"
#include "nodes/supportnodes.h"
#include "optimizer/clauses.h"
#include "optimizer/cost.h"
#include "optimizer/optimizer.h"
#include "optimizer/plancat.h"
#include "optimizer/planmain.h"
#include "parser/analyze.h"
#include "parser/parse_coerce.h"
#include "parser/parse_func.h"
#include "rewrite/rewriteHandler.h"
#include "rewrite/rewriteManip.h"
#include "tcop/tcopprot.h"
#include "utils/acl.h"
#include "utils/builtins.h"
#include "utils/datum.h"
#include "utils/fmgroids.h"
#include "utils/json.h"
#include "utils/jsonb.h"
#include "utils/jsonpath.h"
#include "utils/lsyscache.h"
#include "utils/memutils.h"
#include "utils/syscache.h"
#include "utils/typcache.h"
Go to the source code of this file.
Data Structures | |
struct | eval_const_expressions_context |
struct | substitute_actual_parameters_context |
struct | substitute_actual_srf_parameters_context |
struct | inline_error_callback_arg |
struct | max_parallel_hazard_context |
Macros | |
#define | CCDN_CASETESTEXPR_OK 0x0001 /* CaseTestExpr okay here? */ |
#define | MIN_ARRAY_SIZE_FOR_HASHED_SAOP 9 |
#define | ece_generic_processing(node) |
#define | ece_all_arguments_const(node) (!expression_tree_walker((Node *) (node), contain_non_const_walker, NULL)) |
#define | ece_evaluate_expr(node) |
#define CCDN_CASETESTEXPR_OK 0x0001 /* CaseTestExpr okay here? */ |
#define ece_all_arguments_const | ( | node | ) | (!expression_tree_walker((Node *) (node), contain_non_const_walker, NULL)) |
#define ece_evaluate_expr | ( | node | ) |
#define ece_generic_processing | ( | node | ) |
Definition at line 4326 of file clauses.c.
References generate_unaccent_rules::args, elog, ERROR, fetch_function_defaults(), list_concat_copy(), list_delete_first_n(), list_length(), and pronargs.
Referenced by expand_function_arguments().
void CommuteOpExpr | ( | OpExpr * | clause | ) |
Definition at line 2147 of file clauses.c.
References OpExpr::args, elog, ERROR, get_commutator(), InvalidOid, is_opclause(), linitial, list_length(), lsecond, OidIsValid, and OpExpr::opno.
Referenced by get_switched_clauses().
Definition at line 177 of file clauses.c.
References contain_agg_clause_walker().
Referenced by get_eclass_for_sort_expr(), mark_nullable_by_grouping(), and subquery_planner().
Definition at line 183 of file clauses.c.
References Assert, context, expression_tree_walker, and IsA.
Referenced by contain_agg_clause().
Definition at line 1179 of file clauses.c.
References contain_context_dependent_node_walker().
Referenced by inline_function().
Definition at line 1189 of file clauses.c.
References ArrayCoerceExpr::arg, CaseExpr::arg, CCDN_CASETESTEXPR_OK, ArrayCoerceExpr::elemexpr, expression_tree_walker, IsA, and res.
Referenced by contain_context_dependent_node().
Definition at line 1137 of file clauses.c.
References contain_exec_param_walker().
Referenced by test_opexpr_is_hashable().
Definition at line 1143 of file clauses.c.
References expression_tree_walker, IsA, list_member_int(), PARAM_EXEC, Param::paramid, and Param::paramkind.
Referenced by contain_exec_param().
Definition at line 1263 of file clauses.c.
References contain_leaked_vars_walker().
Referenced by make_plain_restrictinfo(), and qual_is_pushdown_safe().
Definition at line 1269 of file clauses.c.
References get_func_leakproof().
Referenced by contain_leaked_vars_walker().
Definition at line 1275 of file clauses.c.
References MinMaxExpr::args, check_functions_in_node(), TypeCacheEntry::cmp_proc, contain_leaked_vars_checker(), contain_var_clause(), context, expression_tree_walker, SubscriptRoutines::fetch_leakproof, forthree, get_func_leakproof(), get_opcode(), getSubscriptingRoutines(), RowCompareExpr::largs, lfirst, lfirst_oid, lookup_type_cache(), nodeTag, OidIsValid, RowCompareExpr::rargs, SubscriptingRef::refassgnexpr, SubscriptRoutines::store_leakproof, and TYPECACHE_CMP_PROC.
Referenced by contain_leaked_vars().
Definition at line 370 of file clauses.c.
References contain_mutable_functions_walker().
Referenced by can_minmax_aggs(), check_index_predicates(), ComputePartitionAttrs(), contain_mutable_functions_after_planning(), create_bitmap_scan_plan(), create_indexscan_plan(), eval_const_expressions_mutator(), exec_save_simple_expr(), inline_function(), is_foreign_expr(), and relation_excluded_by_constraints().
Definition at line 490 of file clauses.c.
References contain_mutable_functions(), and expression_planner().
Referenced by CheckPredicate(), ComputeIndexAttrs(), and cookDefault().
Definition at line 376 of file clauses.c.
References func_volatile().
Referenced by contain_mutable_functions_walker().
Definition at line 382 of file clauses.c.
References JsonConstructorExpr::args, Assert, castNode, check_functions_in_node(), Const::consttype, contain_mutable_functions_checker(), context, DatumGetJsonPathP(), expression_tree_walker, exprType(), JsonReturning::format, JsonFormat::format_type, IsA, JS_FORMAT_JSONB, jspIsMutable(), lfirst, JsonExpr::passing_names, JsonExpr::passing_values, JsonExpr::path_spec, query_tree_walker, JsonConstructorExpr::returning, to_json_is_immutable(), and to_jsonb_is_immutable().
Referenced by contain_mutable_functions().
Definition at line 3736 of file clauses.c.
References context, expression_tree_walker, and IsA.
Definition at line 993 of file clauses.c.
References contain_nonstrict_functions_walker().
Referenced by inline_function(), and pullup_replace_vars_callback().
Definition at line 999 of file clauses.c.
References func_strict().
Referenced by contain_nonstrict_functions_walker().
Definition at line 1005 of file clauses.c.
References AND_EXPR, arg, BoolExpr::boolop, check_functions_in_node(), contain_nonstrict_functions_checker(), context, expression_tree_walker, SubscriptRoutines::fetch_strict, getSubscriptingRoutines(), IsA, OR_EXPR, and SubscriptingRef::refassgnexpr.
Referenced by contain_nonstrict_functions().
Definition at line 330 of file clauses.c.
References contain_subplans_walker().
Referenced by convert_EXISTS_to_ANY(), ExecInitValuesScan(), find_simplified_clause(), find_window_run_conditions(), initialize_peragg(), inline_function(), inline_set_returning_function(), qual_is_pushdown_safe(), and subquery_planner().
Definition at line 336 of file clauses.c.
References context, expression_tree_walker, and IsA.
Referenced by contain_subplans().
Definition at line 538 of file clauses.c.
References contain_volatile_functions_walker().
Referenced by apply_child_basequals(), check_hashjoinable(), check_mergejoinable(), check_output_expressions(), compute_semijoin_info(), contain_volatile_functions_after_planning(), convert_ANY_sublink_to_join(), convert_EXISTS_sublink_to_join(), convert_EXISTS_to_ANY(), CopyFrom(), distribute_qual_to_rels(), estimate_num_groups(), ExecInitWindowAgg(), expand_indexqual_rowcompare(), find_compatible_agg(), find_simplified_clause(), get_eclass_for_sort_expr(), get_memoize_path(), initialize_peragg(), inline_function(), inline_set_returning_function(), is_pseudo_constant_clause(), is_pseudo_constant_clause_relids(), is_pseudo_constant_for_index(), is_safe_restriction_clause_for(), is_simple_subquery(), is_simple_values(), IsBinaryTidClause(), IsTidEqualAnyClause(), make_sort_input_target(), mark_nullable_by_grouping(), match_clause_to_ordering_op(), match_clause_to_partition_key(), match_opclause_to_indexcol(), match_rowcompare_to_indexcol(), match_saopclause_to_indexcol(), paraminfo_get_equal_hashops(), qual_is_pushdown_safe(), remove_unused_subquery_outputs(), SS_process_ctes(), and subquery_planner().
Definition at line 659 of file clauses.c.
References contain_volatile_functions(), and expression_planner().
Referenced by AddRelationNewConstraints().
Definition at line 544 of file clauses.c.
References func_volatile().
Referenced by contain_volatile_functions_walker().
Definition at line 673 of file clauses.c.
References contain_volatile_functions_not_nextval_walker().
Referenced by BeginCopyFrom().
Definition at line 679 of file clauses.c.
References func_volatile().
Referenced by contain_volatile_functions_not_nextval_walker().
Definition at line 686 of file clauses.c.
References check_functions_in_node(), contain_volatile_functions_not_nextval_checker(), context, expression_tree_walker, IsA, and query_tree_walker.
Referenced by contain_volatile_functions_not_nextval().
Definition at line 550 of file clauses.c.
References check_functions_in_node(), RestrictInfo::clause, contain_volatile_functions_checker(), context, expression_tree_walker, PathTarget::exprs, PathTarget::has_volatile_expr, IsA, query_tree_walker, VOLATILITY_NOVOLATILE, and VOLATILITY_VOLATILE.
Referenced by contain_volatile_functions().
Definition at line 214 of file clauses.c.
References contain_windowfuncs().
Referenced by get_eclass_for_sort_expr(), and mark_nullable_by_grouping().
void convert_saop_to_hashed_saop | ( | Node * | node | ) |
Definition at line 2287 of file clauses.c.
References convert_saop_to_hashed_saop_walker().
Referenced by preprocess_expression().
Definition at line 2293 of file clauses.c.
References ScalarArrayOpExpr::args, ARR_DIMS, ARR_NDIM, ArrayGetNItems(), DatumGetPointer(), expression_tree_walker, get_negator(), get_op_hash_functions(), get_opcode(), IsA, lsecond, MIN_ARRAY_SIZE_FOR_HASHED_SAOP, nitems, OidIsValid, ScalarArrayOpExpr::opno, and ScalarArrayOpExpr::useOr.
Referenced by convert_saop_to_hashed_saop().
|
static |
Definition at line 3752 of file clauses.c.
References context, and func_volatile().
Referenced by eval_const_expressions_mutator().
Node* estimate_expression_value | ( | PlannerInfo * | root, |
Node * | node | ||
) |
Definition at line 2395 of file clauses.c.
References context, eval_const_expressions_mutator(), NIL, and root.
Referenced by array_unnest_support(), bernoulli_samplescangetsamplesize(), clause_selectivity_ext(), generate_series_int4_support(), generate_series_int8_support(), generate_series_timestamp_support(), get_restriction_variable(), gincost_opexpr(), gincost_scalararrayopexpr(), preprocess_limit(), scalararraysel(), system_rows_samplescangetsamplesize(), system_samplescangetsamplesize(), and system_time_samplescangetsamplesize().
Node* eval_const_expressions | ( | PlannerInfo * | root, |
Node * | node | ||
) |
Definition at line 2254 of file clauses.c.
References context, eval_const_expressions_mutator(), NIL, and root.
Referenced by apply_child_basequals(), ATExecAttachPartition(), ConstraintImpliedByRelConstraint(), convert_EXISTS_to_ANY(), DetachAddConstraintIfNeeded(), DoCopy(), expression_planner(), expression_planner_with_deps(), fetch_statentries_for_relation(), get_proposed_default_constraint(), get_relation_constraints(), get_relation_statistics(), preprocess_expression(), preprocess_function_rtes(), process_implied_equality(), RelationBuildPartitionKey(), RelationGetIndexExpressions(), RelationGetIndexPredicate(), and simplify_EXISTS_query().
|
static |
Definition at line 2440 of file clauses.c.
References WindowFunc::aggfilter, AND_EXPR, applyRelabelType(), arg, FieldSelect::arg, RelabelType::arg, CoerceViaIO::arg, ArrayCoerceExpr::arg, ConvertRowtypeExpr::arg, CollateExpr::arg, CaseExpr::arg, NullTest::arg, BooleanTest::arg, CoerceToDomain::arg, generate_unaccent_rules::args, WindowFunc::args, FuncExpr::args, OpExpr::args, BoolExpr::args, CaseExpr::args, RowExpr::args, CoalesceExpr::args, Assert, BoolGetDatum(), BoolExpr::boolop, BooleanTest::booltesttype, castNode, check_stack_depth(), COERCE_IMPLICIT_CAST, CollateExpr::collOid, Const::consttype, contain_mutable_functions(), context, copyObject, datumCopy(), DatumGetBool(), CaseExpr::defresult, DomainHasConstraints(), ece_all_arguments_const, ece_evaluate_expr, ece_function_is_safe(), ece_generic_processing, ArrayCoerceExpr::elemexpr, elog, ERROR, evaluate_expr(), expand_function_arguments(), CaseWhen::expr, exprCollation(), expression_tree_mutator, exprType(), exprTypmod(), FieldSelect::fieldnum, JsonValueExpr::format, JsonValueExpr::formatted_expr, FuncExpr::funcid, get_typlenbyval(), getTypeInputInfo(), getTypeOutputInfo(), HeapTupleIsValid, if(), Int32GetDatum(), InvalidAttrNumber, InvalidOid, IS_FALSE, IS_NOT_FALSE, IS_NOT_NULL, IS_NOT_TRUE, IS_NOT_UNKNOWN, IS_NULL, IS_TRUE, IS_UNKNOWN, IsA, ParamExternData::isnull, lappend(), lfirst, lfirst_node, linitial, list_length(), list_make1, list_make3, list_nth(), Param::location, WindowFunc::location, FuncExpr::location, OpExpr::location, RelabelType::location, CoerceViaIO::location, ConvertRowtypeExpr::location, CollateExpr::location, CaseExpr::location, CaseWhen::location, CoalesceExpr::location, NullTest::location, BooleanTest::location, CoerceToDomain::location, make_andclause(), make_orclause(), makeBoolConst(), makeConst(), makeJsonValueExpr(), makeNode, makeNullConst(), makeVar(), negate_clause(), NIL, nodeTag, NOT_EXPR, NullTest::nulltesttype, ParamListInfoData::numParams, ObjectIdGetDatum(), OidIsValid, OpExpr::opno, OR_EXPR, PARAM_EXTERN, PARAM_FLAG_CONST, ParamListInfoData::paramFetch, Param::paramid, Param::paramkind, ParamListInfoData::params, Param::paramtype, ParamExternData::pflags, ParamExternData::ptype, JsonValueExpr::raw_expr, record_plan_type_dependency(), ReleaseSysCache(), CaseWhen::result, RelabelType::resulttype, CoerceViaIO::resulttype, ConvertRowtypeExpr::resulttype, CoerceToDomain::resulttype, rowtype_field_matches(), SearchSysCache1(), set_opfuncid(), set_sa_opfuncid(), simplify_and_arguments(), simplify_boolean_equality(), simplify_function(), simplify_or_arguments(), SQLValueFunction::typmod, ParamExternData::value, WindowFunc::winfnoid, and WindowFunc::winref.
Referenced by estimate_expression_value(), eval_const_expressions(), inline_function(), simplify_and_arguments(), simplify_function(), and simplify_or_arguments().
Definition at line 4973 of file clauses.c.
References CreateExecutorState(), datumCopy(), EState::es_query_cxt, ExecEvalExprSwitchContext(), ExecInitExpr(), fix_opfuncids(), FreeExecutorState(), get_typlenbyval(), GetPerTupleExprContext, makeConst(), MemoryContextSwitchTo(), PG_DETOAST_DATUM_COPY, and PointerGetDatum().
Referenced by eval_const_expressions_mutator(), evaluate_function(), and transformPartitionBoundValue().
|
static |
Definition at line 4425 of file clauses.c.
References arg, generate_unaccent_rules::args, FuncExpr::args, COERCE_EXPLICIT_CALL, context, evaluate_expr(), FuncExpr::funcid, GETSTRUCT, IsA, lfirst, FuncExpr::location, makeNode, and makeNullConst().
Referenced by simplify_function().
List* expand_function_arguments | ( | List * | args, |
bool | include_out_arguments, | ||
Oid | result_type, | ||
HeapTuple | func_tuple | ||
) |
Definition at line 4175 of file clauses.c.
References add_function_defaults(), arg, generate_unaccent_rules::args, ARR_DATA_PTR, ARR_DIMS, ARR_ELEMTYPE, ARR_HASNULL, ARR_NDIM, Assert, DatumGetArrayTypeP, elog, ERROR, GETSTRUCT, IsA, lfirst, list_length(), pronargs, recheck_cast_function_args(), reorder_function_arguments(), and SysCacheGetAttr().
Referenced by eval_const_expressions_mutator(), simplify_function(), and transformCallStmt().
double expression_returns_set_rows | ( | PlannerInfo * | root, |
Node * | clause | ||
) |
Definition at line 289 of file clauses.c.
References clamp_row_est(), FuncExpr::funcid, get_function_rows(), IsA, root, and set_opfuncid().
Referenced by create_set_projection_path(), estimate_num_groups(), and set_function_size_estimates().
Definition at line 4350 of file clauses.c.
References castNode, pfree(), str, stringToNode(), SysCacheGetAttrNotNull(), and TextDatumGetCString.
Referenced by add_function_defaults(), and reorder_function_arguments().
Definition at line 1977 of file clauses.c.
References NullTest::arg, BooleanTest::arg, BooleanTest::booltesttype, if(), IS_NULL, IS_UNKNOWN, IsA, NullTest::nulltesttype, and Var::varlevelsup.
Referenced by check_redundant_nullability_qual(), and find_forced_null_vars().
Definition at line 1916 of file clauses.c.
References AND_EXPR, BoolExpr::args, BoolExpr::boolop, find_forced_null_var(), FirstLowInvalidHeapAttributeNumber, IsA, lfirst, mbms_add_member(), mbms_add_members(), NIL, Var::varattno, and Var::varno.
Referenced by reduce_outer_joins_pass2().
Definition at line 1456 of file clauses.c.
References find_nonnullable_rels_walker().
Referenced by make_outerjoininfo(), and reduce_outer_joins_pass2().
Definition at line 1462 of file clauses.c.
References AND_EXPR, ANY_SUBLINK, RelabelType::arg, CoerceViaIO::arg, ArrayCoerceExpr::arg, ConvertRowtypeExpr::arg, CollateExpr::arg, NullTest::arg, BooleanTest::arg, FuncExpr::args, OpExpr::args, ScalarArrayOpExpr::args, BoolExpr::args, bms_add_members(), bms_int_members(), bms_is_empty, bms_join(), bms_make_singleton(), bms_membership(), BMS_SINGLETON, BoolExpr::boolop, BooleanTest::booltesttype, elog, ERROR, func_strict(), FuncExpr::funcid, IS_FALSE, IS_NOT_NULL, IS_NOT_UNKNOWN, is_strict_saop(), IS_TRUE, IsA, lfirst, NOT_EXPR, NullTest::nulltesttype, OR_EXPR, PlaceHolderVar::phlevelsup, ROWCOMPARE_SUBLINK, set_opfuncid(), splan, Var::varlevelsup, and Var::varno.
Referenced by find_nonnullable_rels().
Definition at line 1707 of file clauses.c.
References find_nonnullable_vars_walker().
Referenced by reduce_outer_joins_pass2().
Definition at line 1713 of file clauses.c.
References AND_EXPR, ANY_SUBLINK, RelabelType::arg, CoerceViaIO::arg, ArrayCoerceExpr::arg, ConvertRowtypeExpr::arg, CollateExpr::arg, NullTest::arg, BooleanTest::arg, FuncExpr::args, OpExpr::args, ScalarArrayOpExpr::args, BoolExpr::args, BoolExpr::boolop, BooleanTest::booltesttype, elog, ERROR, FirstLowInvalidHeapAttributeNumber, func_strict(), FuncExpr::funcid, IS_FALSE, IS_NOT_NULL, IS_NOT_UNKNOWN, is_strict_saop(), IS_TRUE, IsA, lfirst, mbms_add_member(), mbms_add_members(), mbms_int_members(), NIL, NOT_EXPR, NullTest::nulltesttype, OR_EXPR, ROWCOMPARE_SUBLINK, set_opfuncid(), splan, Var::varattno, Var::varlevelsup, and Var::varno.
Referenced by find_nonnullable_vars().
WindowFuncLists* find_window_functions | ( | Node * | clause, |
Index | maxWinRef | ||
) |
Definition at line 227 of file clauses.c.
References find_window_functions_walker(), WindowFuncLists::maxWinRef, WindowFuncLists::numWindowFuncs, palloc(), palloc0(), and WindowFuncLists::windowFuncs.
Referenced by grouping_planner().
|
static |
Definition at line 239 of file clauses.c.
References Assert, elog, ERROR, expression_tree_walker, IsA, lappend(), list_member(), WindowFuncLists::maxWinRef, WindowFuncLists::numWindowFuncs, WindowFuncLists::windowFuncs, and WindowFunc::winref.
Referenced by find_window_functions().
|
static |
Definition at line 4551 of file clauses.c.
References ACL_EXECUTE, ACLCHECK_OK, ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, arg, CollateExpr::arg, ErrorContextCallback::arg, generate_unaccent_rules::args, FuncExpr::args, ErrorContextCallback::callback, castNode, check_sql_fn_retval(), CMD_SELECT, COERCE_EXPLICIT_CALL, CollateExpr::collOid, contain_context_dependent_node(), contain_mutable_functions(), contain_nonstrict_functions(), contain_subplans(), contain_volatile_functions(), context, copyObject, cost_qual_eval(), cpu_operator_cost, CurrentMemoryContext, error_context_stack, eval_const_expressions_mutator(), exprCollation(), exprType(), FmgrHookIsNeeded, free_parsestate(), FuncExpr::funcid, get_expr_result_type(), GETSTRUCT, GetUserId(), heap_attisnull(), i, IsA, lappend_oid(), lfirst, linitial, linitial_node, list_delete_last(), list_length(), list_make1, list_member_oid(), FuncExpr::location, CollateExpr::location, make_parsestate(), makeNode, MemoryContextDelete(), MemoryContextSwitchTo(), NameStr, object_aclcheck(), OidIsValid, ParseState::p_sourcetext, palloc0(), QualCost::per_tuple, pg_parse_query(), prepare_sql_fn_parse_info(), ErrorContextCallback::previous, inline_error_callback_arg::proname, inline_error_callback_arg::prosrc, querytree(), record_plan_function_dependency(), sql_fn_parser_setup(), sql_inline_error_callback(), QualCost::startup, stringToNode(), substitute_actual_parameters(), SysCacheGetAttr(), SysCacheGetAttrNotNull(), TextDatumGetCString, and transformTopLevelStmt().
Referenced by simplify_function().
Query* inline_set_returning_function | ( | PlannerInfo * | root, |
RangeTblEntry * | rte | ||
) |
Definition at line 5065 of file clauses.c.
References ACL_EXECUTE, ACLCHECK_OK, AcquireRewriteLocks(), ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, ErrorContextCallback::arg, FuncExpr::args, Assert, BuildDescFromLists(), ErrorContextCallback::callback, castNode, check_sql_fn_retval(), check_stack_depth(), CMD_SELECT, contain_subplans(), contain_volatile_functions(), copyObject, CurrentMemoryContext, elog, ERROR, error_context_stack, FmgrHookIsNeeded, RangeTblFunction::funcexpr, FuncExpr::funcid, RangeTblEntry::funcordinality, RangeTblEntry::functions, get_expr_result_type(), GETSTRUCT, GetUserId(), heap_attisnull(), HeapTupleIsValid, if(), IsA, linitial, linitial_node, list_length(), list_make1, MemoryContextDelete(), MemoryContextSwitchTo(), NameStr, NIL, object_aclcheck(), ObjectIdGetDatum(), pg_analyze_and_rewrite_withcb(), pg_parse_query(), pg_rewrite_query(), prepare_sql_fn_parse_info(), ErrorContextCallback::previous, inline_error_callback_arg::proname, inline_error_callback_arg::prosrc, querytree(), record_plan_function_dependency(), ReleaseSysCache(), root, RTE_FUNCTION, RangeTblEntry::rtekind, SearchSysCache1(), sql_fn_parser_setup(), sql_inline_error_callback(), stringToNode(), substitute_actual_srf_parameters(), SysCacheGetAttr(), SysCacheGetAttrNotNull(), TextDatumGetCString, TYPEFUNC_COMPOSITE, TYPEFUNC_COMPOSITE_DOMAIN, and TYPEFUNC_RECORD.
Referenced by preprocess_function_rtes().
bool is_parallel_safe | ( | PlannerInfo * | root, |
Node * | node | ||
) |
Definition at line 753 of file clauses.c.
References context, PlannerInfo::init_plans, lfirst, list_concat(), max_parallel_hazard_walker(), NIL, root, and SubPlan::setParam.
Referenced by apply_projection_to_path(), build_join_rel(), create_minmaxagg_path(), create_projection_path(), create_set_projection_path(), create_window_paths(), find_computable_ec_member(), grouping_planner(), make_grouping_rel(), plan_create_index_workers(), query_planner(), relation_can_be_sorted_early(), and set_rel_consider_parallel().
Definition at line 2088 of file clauses.c.
References contain_var_clause(), and contain_volatile_functions().
Referenced by clauselist_selectivity_ext(), dependency_is_compatible_clause(), dependency_is_compatible_expression(), and find_window_run_conditions().
Definition at line 2108 of file clauses.c.
References bms_is_empty, and contain_volatile_functions().
Referenced by clauselist_selectivity_ext().
|
static |
Definition at line 2026 of file clauses.c.
References ScalarArrayOpExpr::args, ARR_DIMS, ARR_NDIM, ArrayGetNItems(), Assert, DatumGetArrayTypeP, ArrayExpr::elements, func_strict(), IsA, list_length(), lsecond, NIL, nitems, set_sa_opfuncid(), and ScalarArrayOpExpr::useOr.
Referenced by find_nonnullable_rels_walker(), and find_nonnullable_vars_walker().
char max_parallel_hazard | ( | Query * | parse | ) |
Definition at line 734 of file clauses.c.
References context, max_parallel_hazard_walker(), NIL, and parse().
Referenced by standard_planner().
Definition at line 822 of file clauses.c.
References context, func_parallel(), and max_parallel_hazard_test().
Referenced by max_parallel_hazard_walker().
|
static |
Definition at line 794 of file clauses.c.
References Assert, context, elog, and ERROR.
Referenced by max_parallel_hazard_checker(), and max_parallel_hazard_walker().
|
static |
Definition at line 829 of file clauses.c.
References SubPlan::args, check_functions_in_node(), RestrictInfo::clause, context, expression_tree_walker, IsA, list_concat_copy(), list_free(), list_member_int(), max_parallel_hazard_checker(), max_parallel_hazard_test(), SubPlan::parallel_safe, PARAM_EXEC, PARAM_EXTERN, Param::paramid, SubPlan::paramIds, Param::paramkind, query_tree_walker, Query::rowMarks, and SubPlan::testexpr.
Referenced by is_parallel_safe(), and max_parallel_hazard().
int NumRelids | ( | PlannerInfo * | root, |
Node * | clause | ||
) |
Definition at line 2130 of file clauses.c.
References bms_del_members(), bms_free(), bms_num_members(), pull_varnos(), and root.
Referenced by clauselist_selectivity_ext(), rowcomparesel(), and treat_as_join_clause().
Definition at line 5418 of file clauses.c.
References pull_paramids_walker().
Referenced by create_memoize_plan().
Definition at line 5428 of file clauses.c.
References bms_add_member(), context, expression_tree_walker, IsA, and Param::paramid.
Referenced by pull_paramids().
|
static |
Definition at line 4380 of file clauses.c.
References generate_unaccent_rules::args, Assert, elog, enforce_generic_type_consistency(), ERROR, exprType(), FUNC_MAX_ARGS, GETSTRUCT, lfirst, list_length(), make_fn_arguments(), and pronargs.
Referenced by expand_function_arguments().
Definition at line 4256 of file clauses.c.
References arg, NamedArgExpr::arg, NamedArgExpr::argnumber, generate_unaccent_rules::args, Assert, elog, ERROR, fetch_function_defaults(), FUNC_MAX_ARGS, GETSTRUCT, i, IsA, lappend(), lfirst, list_length(), NIL, and pronargs.
Referenced by expand_function_arguments().
|
static |
Definition at line 2186 of file clauses.c.
References lookup_rowtype_tupdesc_domain(), TupleDescData::natts, ReleaseTupleDesc, and TupleDescAttr.
Referenced by eval_const_expressions_mutator().
|
static |
Definition at line 3896 of file clauses.c.
References arg, generate_unaccent_rules::args, context, DatumGetBool(), eval_const_expressions_mutator(), is_andclause(), IsA, lappend(), linitial, list_concat_copy(), list_copy(), list_delete_first(), list_free(), and NIL.
Referenced by eval_const_expressions_mutator().
Definition at line 3990 of file clauses.c.
References generate_unaccent_rules::args, Assert, DatumGetBool(), IsA, linitial, list_length(), lsecond, and negate_clause().
Referenced by eval_const_expressions_mutator().
|
static |
Definition at line 4059 of file clauses.c.
References generate_unaccent_rules::args, FuncExpr::args, Assert, COERCE_EXPLICIT_CALL, context, DatumGetPointer(), elog, ERROR, eval_const_expressions_mutator(), evaluate_function(), expand_function_arguments(), expression_tree_mutator, SupportRequestSimplify::fcall, FuncExpr::funcid, GETSTRUCT, HeapTupleIsValid, inline_function(), FuncExpr::location, ObjectIdGetDatum(), OidFunctionCall1, OidIsValid, PointerGetDatum(), ReleaseSysCache(), SupportRequestSimplify::root, SearchSysCache1(), SupportRequestSimplify::type, and FuncExpr::xpr.
Referenced by eval_const_expressions_mutator().
|
static |
Definition at line 3790 of file clauses.c.
References arg, generate_unaccent_rules::args, context, DatumGetBool(), eval_const_expressions_mutator(), is_orclause(), IsA, lappend(), linitial, list_concat_copy(), list_copy(), list_delete_first(), list_free(), and NIL.
Referenced by eval_const_expressions_mutator().
|
static |
Definition at line 4949 of file clauses.c.
References arg, errcontext, errposition(), geterrposition(), internalerrposition(), internalerrquery(), inline_error_callback_arg::proname, and inline_error_callback_arg::prosrc.
Referenced by inline_function(), and inline_set_returning_function().
|
static |
Definition at line 4907 of file clauses.c.
References generate_unaccent_rules::args, context, and substitute_actual_parameters_mutator().
Referenced by inline_function().
|
static |
Definition at line 4920 of file clauses.c.
References context, elog, ERROR, expression_tree_mutator, IsA, list_nth(), PARAM_EXTERN, Param::paramid, and Param::paramkind.
Referenced by substitute_actual_parameters().
Definition at line 5358 of file clauses.c.
References generate_unaccent_rules::args, context, query_tree_mutator, and substitute_actual_srf_parameters_mutator().
Referenced by inline_set_returning_function().
|
static |
Definition at line 5373 of file clauses.c.
References context, copyObject, elog, ERROR, expression_tree_mutator, IncrementVarSublevelsUp(), IsA, list_nth(), PARAM_EXTERN, Param::paramid, Param::paramkind, and query_tree_mutator.
Referenced by substitute_actual_srf_parameters().