# The functions of src/agg/plan*.c and spec*.c whose `return false` names no refusal (scripts/gen-refusals.sh checks it). # Format: file.c: function function # reason. False in these means "not this shape", "keep walking" or "this try does not apply", and the caller that # gives the arm up names the refusal. A reason recorded in a try would be the first of the arm and would hide the one that follows it (the arm keeps # the first reason it gets), so a try never names one. base.c: left_lateral group_has_partition_key eq_joined # predicates of the shape and the mid-way tries of agg_base, and the walker that finds the column a where refusal names: the sites that give the arm up name the slug finish.c: unsafe_in_worker key_spelling member_source reads_overflow reads_json_null_cast # predicates of the shape and the mid-way tries of agg_base, and the walker that finds the column a where refusal names: the sites that give the arm up name the slug paths.c: groupClause_has_nonconst # predicates of the shape and the mid-way tries of agg_base, and the walker that finds the column a where refusal names: the sites that give the arm up name the slug quals.c: missing_column_walker # predicates of the shape and the mid-way tries of agg_base, and the walker that finds the column a where refusal names: the sites that give the arm up name the slug plan_agg.c: compile_combo_key compile_key unique_row_column compile_vx compile_ordered same_sorted_input mapped_pg_agg compile_mapped count_rows_kind compile_int8_agg leaf_agg_kind compile_leaf_agg compile_native_agg compile_agg compile_int_agg # tries of compile_agg (native, mapped, ordered, generic in turn): compile_agg and its caller name the aggregate plan_child.c: derived_column_walker bare_read_walker planned_child first_key_ok first_filter_bad first_order scoped_child ancestor_param_walker # tries of the lookup child: the caller of planned_correlated_child names join_child plan_combo.c: join_holds_walker join_test_walker join_test_expr table_key_expr join_clause combo_walker nonzero_const func_may_raise may_raise_walker join_expr_clause combo_slot_in # tries of the join key and of the combo slot: setup_joins and the callers name the join condition or the expression combo.c: real_cost_walker hashed_subplan_walker calendar_cost_walker json_build_walker elements_walker combo_tests_elements # predicates of the cost model and the walkers it uses: no refusal cte.c: key_list_walker body_guessed # predicates of the cost model and the walkers it uses: no refusal join.c: join_lut lookup_counted extern_param_walker rel_has_param_qual join_index_usable # predicates of the cost model and the walkers it uses: no refusal leaf.c: pred_uses_leaf leaf_read_whole leaf_filtered leaf_copy_only leaf_values_used leaf_tested leaf_compared_only # predicates of the cost model and the walkers it uses: no refusal plan_exists.c: exists_scan dep_walker out_walker # shape tests of the EXISTS rewrite: the caller names from_shape or where part.c: part_preagg_common exec_param_walker mentions_key hash_clause_handled part_prune_clauses part_has_index # tests of the FROM list (outer joins are tried both ways round) and of a recordset: the caller names from_shape, outer_join or partition_source reads.c: unconditional leaf_read count_leaf_reads others_first filtered_reads pred_reads_leaf pred_reads_any pred_reads_set list_read_by_tuple_tests # tests of the FROM list (outer joins are tried both ways round) and of a recordset: the caller names from_shape, outer_join or partition_source recheck.c: member_casts # tests of the FROM list (outer joins are tried both ways round) and of a recordset: the caller names from_shape, outer_join or partition_source scan.c: right_only scan_preserved scan_semi_tree # tests of the FROM list (outer joins are tried both ways round) and of a recordset: the caller names from_shape, outer_join or partition_source source.c: find_source text_io_leaf recordset_recheck_ok # tests of the FROM list (outer joins are tried both ways round) and of a recordset: the caller names from_shape, outer_join or partition_source plan_gen.c: gen_leaf_ok gen_walker slice_walker arg_joined compile_gen_arg spelling_free gen_eligible compile_gen # tests of a generic aggregate and its argument: compile_gen names the aggregate plan_join.c: reads_outer preserved_join lookup_ready child_cols_kept pushed_into_child null_row_passes column_equality array_keys # tests of one join condition or lookup (each is tried in turn): setup_joins names join_condition plan_path.c: jsonb_lit path_lit # tests of a jsonpath literal: the caller names where plan_pred.c: false_on_absent # a test of a compiled predicate: no refusal plan_not.c: negate_existential # a test of a compiled predicate: no refusal plan_rows.c: pg_aggregate_ok # a test of an aggregate of the rows plan: the caller names rows_shape plan_range_join.c: range_conds # the conditions of one range of a join on a range: false is "the range is not one this can read", and the estimate stays the planner's, no refusal arms.c: append_arms same_scan from_same cond_split outer_cond # steps of the two-level shape: two_level names two_arms, two_keys, two_aggs or spine_shape inner.c: arm_gates arm_having_expr outer_agg # steps of the two-level shape: two_level names two_arms, two_keys, two_aggs or spine_shape spine.c: spine_key two_keys two_aggs spine_where null_in_arms two_from spine_type spine_eq spine_conjunct two_spine # steps of the two-level shape: two_level names two_arms, two_keys, two_aggs or spine_shape plan_jindex.c: index_qual # a condition that is no bound or point of an index scan: the table is read whole, join_filter names nothing plan_type.c: typeof_cmp_operands typeof_test wide_test shape_test range_unary_test types_guard_reads # tests of a jsonb_typeof, wide or range or network comparison: the caller names where plan_not.c: source_tests_only complementable # a predicate that is not an AND / OR of the source's tests is not one: a question, not a refusal plan_zone.c: array_consts zone_range_read zone_meets zone_may in_list_shape # zone pruning tests: a unit that cannot be pruned is read, no refusal spec_lits.c: re_lits like_lits sift_pattern_lits_of call_lits sift_pattern_lits # the literals a pattern requires: false is "none that are read", and the dictionary test then runs the pattern on every string spec.c: sift_aggspec_ascii_fold sift_aggspec_spillable sift_parse_decimal sift_aggspec_zone_cmp sift_aggspec_span_pred str_const like_test regex_literal pattern_test str_call_test strpos_test ilike_test str_in_test str_leaf_test sift_aggspec_elem_test # tests of a compiled spec (parallel workers, string tests): a scan that cannot use workers or a kernel is not a refusal plan_contains.c: elem_lit array_eq_args # the constant is not an element of a list the directory knows: the shape is read from the units, no refusal build.c: fuse_leaves fuse_children fuse_build fuse_key_slots fuse_candidate sift_aggspec_fusable # fusing the arms of a spec: arms that do not fuse run as separate scans, no refusal join.c: combo_same fuse_join fuse_combo fuse_fslots # fusing the arms of a spec: arms that do not fuse run as separate scans, no refusal pred.c: fuse_posts pred_runs_plan fuse_aggs routable fuse_split # fusing the arms of a spec: arms that do not fuse run as separate scans, no refusal spec_preagg.c: plain_leaf pa_pres sift_pawhy_fixable add_leaf pred_dims in_leaves rows_zone_bound cal_pred cal_tests cal_alt # pre-aggregate decisions: a miss is counted by sift.col_rollup_misses, no refusal shape.c: topn_unique_key # a test of the join table's indexes: topn_joins_ok names topn_shape keys.c: topn_raw_key # a test of the first key leaf: the scan reads it through the datums of the unit, not as the stored codes, and is no less a top-N cost.c: topn_bounds # an early guard of topn_paths: a query without a usable LIMIT is no top-N candidate, so no arm is open to refuse shape.c: topn_array_pred topn_array_ok topn_runs_ok # tests of whether the executor reads the order array of the key: a path that fails them is priced as the scan of units it also is, no arm is refused keys.c: topn_num_type topn_in_leaf_ok topn_expr_walker topn_key # type tests and the walker of a sort expression (its reason is kept in the walk): topn_paths names topn_shape with it plan_cal.c: cal_func period_func # tests of whether a comparison is a calendar step against a constant of the supported years: a comparison that fails them stays an expression of the leaf (a LUT), no arm is refused base.c: agg_base # the refusal is the one agg_base_once noted (the unnest retry keeps it when it fails too) paths.c: has_subquery_rte normal_under_floor # the test of whether the arms are worth planning at all (a normal plan too cheap for any scan): no arm is tried, so none refuses; sift.explain_why plans them all drop.c: column_key input_key sort_entry ord_append ord_has # walks of a finished plan that tell whether a Sort can go: a plan that does not fit is left as it is, no refusal join.c: index_covers join_keys_pay # cost tests of a keyed load (does the btree cover the columns it reads, does the load pay): a no leaves the join to the scan of its table, no arm is refused keys.c: agg_unique_keys_first lookup_add # a cost test of the unique b-tree against the scan, and the room for a column among the lookups of a top-N: a no leaves the plan as it is, no arm is refused model.c: btree_presorts # whether a b-tree gives the first key of the order: the top-N is priced with or without it, no arm is refused rank.c: rank_varied sort_keys_ok # tests of whether a sort is worth the rank sort of SiftSort: a sort that fails them is left to PostgreSQL's, no arm is refused shape.c: topn_one_leaf # whether the scan reads one partition whose order array it can walk: a top-N that fails it is priced as the scan of units it also is, no arm is refused plan_ord.c: has_sorted_agg # a test of the aggregates of a path (an ORDER BY or DISTINCT of their own): the caller names the refusal paths.c: has_correlated_children # a test of the path for the plan of a correlated child: the caller decides what it means for the arm, no refusal is recorded here plan_prednorm.c: widening # a test of whether a comparison widens the type of its column: a comparison that does stays an expression of the leaf, no arm is refused spec.c: sift_aggspec_gstream sift_aggspec_ord_range # tests of whether a spilled scan can give its groups in the order of the ORDER BY: a no spills the groups and sorts them, no arm is refused plan_contains.c: path_declared # a lookup of the leaf at a path of a jsonb column: the caller says the path is undeclared and runs the containment on the leaves, no arm is refused plan_type.c: haskey_reads # a walk of the query for the reads of the document and of the key leaf besides the test doc ? 'k': compile_haskey says no, and the conjunct stays the normal plan's