Skip to content

File query_planner.c

FileList > cubrid > src > optimizer > query_planner.c

Go to the source code of this file

  • #include "config.h"
  • #include <stdio.h>
  • #include <stdlib.h>
  • #include <math.h>
  • #include <assert.h>
  • #include <values.h>
  • #include "jansson.h"
  • #include "parser.h"
  • #include "object_primitive.h"
  • #include "optimizer.h"
  • #include "query_planner.h"
  • #include "query_graph.h"
  • #include "environment_variable.h"
  • #include "misc_string.h"
  • #include "system_parameter.h"
  • #include "parser_message.h"
  • #include "intl_support.h"
  • #include "storage_common.h"
  • #include "xasl_analytic.hpp"
  • #include "xasl_generation.h"
  • #include "schema_manager.h"
  • #include "network_interface_cl.h"
  • #include "dbtype.h"
  • #include "regu_var.hpp"

Classes

Type Name
struct ndv_info

Public Types

Type Name
enum JOIN_ORDER_TRY
typedef struct ndv_info NDV_INFO
enum PRED_CLASS
typedef enum PRED_CLASS PRED_CLASS
typedef int(* QO_WALK_FUNCTION

Public Attributes

Type Name
QO_PLAN_VTBL * all_vtbls = /* multi line expression */

Public Static Attributes

Type Name
int infos_allocated = 0
int infos_deallocated = 0
int qo_accumulating_plans
QO_PLAN_VTBL qo_follow_plan_vtbl = /* multi line expression */
QO_PLAN_VTBL qo_hash_join_plan_vtbl = /* multi line expression */
QO_PLAN_VTBL qo_idx_join_plan_vtbl = /* multi line expression */
QO_PLAN_VTBL qo_index_scan_plan_vtbl = /* multi line expression */
QO_PLAN_VTBL qo_merge_join_plan_vtbl = /* multi line expression */
int qo_next_tmpfile
QO_PLAN_VTBL qo_nl_join_plan_vtbl = /* multi line expression */
QO_PLAN * qo_plan_free_list
int qo_plans_allocated
int qo_plans_deallocated
int qo_plans_demalloced
int qo_plans_malloced
QO_PLAN_VTBL qo_seq_scan_plan_vtbl = /* multi line expression */
QO_PLAN_VTBL qo_set_follow_plan_vtbl = /* multi line expression */
QO_PLAN_VTBL qo_sort_plan_vtbl = /* multi line expression */
QO_PLAN_VTBL qo_worst_plan_vtbl = /* multi line expression */

Public Functions

Type Name
QO_PLAN_PARALLEL_OPT_USE qo_check_hjoin_for_parallel_opt (QO_PLAN * plan)
double qo_expr_selectivity (QO_ENV * env, PT_NODE * pt_expr)
int qo_has_like_recompile_candidate (QO_PLAN * plan, void * arg)
bool qo_has_sort_limit_subplan (QO_PLAN * plan)
void qo_info_stats (FILE * f)
bool qo_is_all_unique_index_columns_are_equi_terms (QO_PLAN * plan)
bool qo_is_interesting_order_scan (QO_PLAN * plan)
bool qo_is_iscan (QO_PLAN * plan)
bool qo_is_iscan_from_groupby (QO_PLAN * plan)
bool qo_is_iscan_from_orderby (QO_PLAN * plan)
bool qo_is_seq_scan (QO_PLAN * plan)
PT_NODE * qo_plan_compute_iscan_sort_list (QO_PLAN * root, PT_NODE * group_by, bool * is_index_w_prefix, bool for_min_max_optimize)
void qo_plan_discard (QO_PLAN * plan)
void qo_plan_dump (QO_PLAN * plan, FILE * output)
int qo_plan_get_cost_fn (const char * plan_name)
void qo_plan_lite_print (QO_PLAN * plan, FILE * f, int howfar)
const char * qo_plan_set_cost_fn (const char * plan_name, int fn)
void qo_planner_free (QO_PLANNER * planner)
QO_PLAN * qo_planner_search (QO_ENV * env)
void qo_plans_stats (FILE * f)
void qo_top_plan_print_json (PARSER_CONTEXT * parser, xasl_node * xasl, PT_NODE * select, QO_PLAN * plan)
void qo_top_plan_print_text (PARSER_CONTEXT * parser, xasl_node * xasl, PT_NODE * select, QO_PLAN * plan)

Public Static Functions

Type Name
double log3 (double n)
double planner_nodeset_join_cost (QO_PLANNER * planner, BITSET * nodeset)
void planner_permutate (QO_PLANNER * planner, QO_PARTITION * partition, PT_HINT_ENUM hint, QO_NODE * prev_head_node, BITSET * visited_nodes, BITSET * visited_rel_nodes, BITSET * visited_terms, BITSET * nested_path_nodes, BITSET * remaining_nodes, BITSET * remaining_terms, BITSET * remaining_subqueries, int num_path_inner, int * node_idxp)
void planner_visit_node (QO_PLANNER * planner, QO_PARTITION * partition, PT_HINT_ENUM hint, QO_NODE * head_node, QO_NODE * tail_node, BITSET * visited_nodes, BITSET * visited_rel_nodes, BITSET * visited_terms, BITSET * nested_path_nodes, BITSET * remaining_nodes, BITSET * remaining_terms, BITSET * remaining_subqueries, int num_path_inner)
double qo_all_some_in_selectivity (QO_ENV * env, PT_NODE * pt_expr)
QO_INFO * qo_alloc_info (QO_PLANNER * planner, BITSET * nodes, BITSET * terms, BITSET * eqclasses, double cardinality, double total_rows)
QO_PLANNER * qo_alloc_planner (QO_ENV * env)
double qo_and_selectivity (QO_ENV * env, double lhs_sel, double rhs_sel)
double qo_between_selectivity (QO_ENV * env, PT_NODE * pt_expr)
bool qo_can_apply_limit_card (QO_ENV * env)
bool qo_check_groupby_skip_descending (QO_PLAN * plan, PT_NODE * list)
int qo_check_like_recompile_candidate (QO_PLAN * plan, void * arg)
bool qo_check_new_best_plan_on_info (QO_INFO * info, QO_PLAN * plan)
bool qo_check_orderby_skip_descending (QO_PLAN * plan)
int qo_check_plan_on_info (QO_INFO * info, QO_PLAN * plan)
QO_PLAN_COMPARE_RESULT qo_check_planvec (QO_PLANVEC * planvec, QO_PLAN * plan)
bool qo_check_skip_term (QO_ENV * env, BITSET visited_segs, QO_TERM * term, BITSET * visited_terms, BITSET * cur_visited_terms)
PRED_CLASS qo_classify (PT_NODE * attr)
void qo_clean_planner (QO_PLANNER * planner)
QO_PLAN_COMPARE_RESULT qo_cmp_planvec (QO_PLANVEC * planvec, QO_PLAN * plan)
QO_PLAN * qo_combine_partitions (QO_PLANNER * planner, BITSET * reamining_subqueries)
double qo_comp_selectivity (QO_ENV * env, PT_NODE * pt_expr)
void qo_compute_projected_segs (QO_PLANNER * planner, BITSET * nodes, BITSET * terms, BITSET * projected)
int qo_compute_projected_size (QO_PLANNER * planner, BITSET * segset)
QO_PLAN * qo_cp_new (QO_INFO * info, QO_PLAN * outer, QO_PLAN * inner, BITSET * sarged_terms, BITSET * pinned_subqueries)
void qo_detach_info (QO_INFO * info)
void qo_dump_info (QO_INFO * info, FILE * f)
void qo_dump_planner_info (QO_PLANNER * planner, QO_PARTITION * partition, FILE * f)
void qo_dump_planvec (QO_PLANVEC * planvec, FILE * f, int indent)
double qo_equal_selectivity (QO_ENV * env, PT_NODE * pt_expr)
double qo_estimate_ndv (double N, double p, double n)
void qo_estimate_ngroups (QO_PLAN * plan, SORT_TYPE sort_type)
int qo_examine_correlated_index (QO_INFO * info, JOIN_TYPE join_type, QO_INFO * outer, QO_INFO * inner, BITSET * afj_terms, BITSET * sarged_terms, BITSET * pinned_subqueries)
int qo_examine_follow (QO_INFO * info, QO_TERM * path_term, QO_INFO * head_info, BITSET * sarged_terms, BITSET * pinned_subqueries)
int qo_examine_hash_join (QO_INFO * info, JOIN_TYPE join_type, QO_INFO * outer, QO_INFO * inner, BITSET * hash_join_terms, BITSET * duj_terms, BITSET * afj_terms, BITSET * sarged_terms, BITSET * pinned_subqueries)
int qo_examine_idx_join (QO_INFO * info, JOIN_TYPE join_type, QO_INFO * outer, QO_INFO * inner, BITSET * afj_terms, BITSET * sarged_terms, BITSET * pinned_subqueries)
int qo_examine_merge_join (QO_INFO * info, JOIN_TYPE join_type, QO_INFO * outer, QO_INFO * inner, BITSET * sm_join_terms, BITSET * duj_terms, BITSET * afj_terms, BITSET * sarged_terms, BITSET * pinned_subqueries)
int qo_examine_nl_join (QO_INFO * info, JOIN_TYPE join_type, QO_INFO * outer, QO_INFO * inner, BITSET * nl_join_terms, BITSET * duj_terms, BITSET * afj_terms, BITSET * sarged_terms, BITSET * pinned_subqueries, int idx_join_plan_n, BITSET * hash_terms)
QO_PLAN * qo_find_best_nljoin_inner_plan_on_info (QO_PLAN * outer, QO_INFO * info, JOIN_TYPE join_type, int idx_join_plan_n)
QO_PLAN * qo_find_best_plan_on_info (QO_INFO * info, QO_EQCLASS * order, double n)
QO_PLAN * qo_find_best_plan_on_planvec (QO_PLANVEC * planvec, double n)
void qo_follow_cost (QO_PLAN * planp)
void qo_follow_fprint (QO_PLAN * plan, FILE * f, int howfar)
void qo_follow_info (QO_PLAN * plan, FILE * f, int howfar)
QO_PLAN * qo_follow_new (QO_INFO * info, QO_PLAN * head_plan, QO_TERM * path_term, BITSET * sarged_terms, BITSET * pinned_subqueries)
void qo_follow_walk (QO_PLAN * plan, void(*)(QO_PLAN *, void *) child_fn, void * child_data, void(*)(QO_PLAN *, void *) parent_fn, void * parent_data)
void qo_free_info (QO_INFO * info)
int qo_generate_index_scan (QO_INFO * infop, QO_NODE * nodep, QO_NODE_INDEX_ENTRY * ni_entryp, int nsegs)
int qo_generate_join_index_scan (QO_INFO * infop, JOIN_TYPE join_type, QO_PLAN * outer_plan, QO_INFO * inner, QO_NODE * nodep, QO_NODE_INDEX_ENTRY * ni_entryp, BITSET * indexable_terms, BITSET * afj_terms, BITSET * sarged_terms, BITSET * pinned_subqueries)
int qo_generate_loose_index_scan (QO_INFO * infop, QO_NODE * nodep, QO_NODE_INDEX_ENTRY * ni_entryp)
void qo_generate_seq_scan (QO_INFO * infop, QO_NODE * nodep)
int qo_generate_sort_limit_plan (QO_ENV * env, QO_INFO * infop, QO_PLAN * subplan)
void qo_generic_walk (QO_PLAN * plan, void(*)(QO_PLAN *, void *) child_fn, void * child_data, void(*)(QO_PLAN *, void *) parent_fn, void * parent_data)
PT_NODE * qo_get_col_product_ndv (PARSER_CONTEXT * parser, PT_NODE * tree, void * arg, int * continue_walk)
int qo_get_group_ndv (QO_PLAN * plan, SORT_TYPE sort_type)
void qo_get_term_hit_prob (QO_TERM * term, QO_INFO * head_info, QO_INFO * tail_info, QO_ENV * env, double * out_head_factor, double * out_tail_factor)
QO_PLAN_COMPARE_RESULT qo_group_by_skip_plans_cmp (QO_PLAN * a, QO_PLAN * b)
int qo_has_is_not_null_term (QO_NODE * node)
void qo_hjoin_cost (QO_PLAN * plan_p)
void qo_hjoin_fprint (QO_PLAN * plan, FILE * f, int howfar)
int qo_index_cardinality (QO_ENV * env, PT_NODE * attr)
int qo_index_cardinality_with_dedup (QO_ENV * env, PT_NODE * attr, BITSET * seg_bitset)
QO_PLAN_COMPARE_RESULT qo_index_covering_plans_cmp (QO_PLAN * a, QO_PLAN * b)
bool qo_index_has_bit_attr (QO_INDEX_ENTRY * index_entryp)
QO_PLAN * qo_index_scan_new (QO_INFO * info, QO_NODE * node, QO_NODE_INDEX_ENTRY * ni_entry, QO_SCANMETHOD scan_method, BITSET * range_terms, BITSET * indexable_terms)
void qo_info_nodes_init (QO_ENV * env)
void qo_init_planvec (QO_PLANVEC * planvec)
bool qo_is_sort_limit (QO_PLAN * plan)
void qo_iscan_cost (QO_PLAN * planp)
void qo_join_fprint (QO_PLAN * plan, FILE * f, int howfar)
void qo_join_free (QO_PLAN * plan)
void qo_join_info (QO_PLAN * plan, FILE * f, int howfar)
QO_PLAN * qo_join_new (QO_INFO * info, JOIN_TYPE join_type, QO_JOINMETHOD join_method, QO_PLAN * outer, QO_PLAN * inner, BITSET * join_terms, BITSET * duj_terms, BITSET * afj_terms, BITSET * sarged_terms, BITSET * pinned_subqueries, BITSET * hash_terms)
void qo_join_walk (QO_PLAN * plan, void(*)(QO_PLAN *, void *) child_fn, void * child_data, void(*)(QO_PLAN *, void *) parent_fn, void * parent_data)
void qo_mjoin_cost (QO_PLAN * planp)
QO_PLAN_COMPARE_RESULT qo_multi_range_opt_plans_cmp (QO_PLAN * a, QO_PLAN * b)
void qo_nljoin_cost (QO_PLAN * planp)
double qo_not_selectivity (QO_ENV * env, double sel)
double qo_or_selectivity (QO_ENV * env, double lhs_sel, double rhs_sel)
QO_PLAN_COMPARE_RESULT qo_order_by_skip_plans_cmp (QO_PLAN * a, QO_PLAN * b)
void qo_plan_add_to_free_list (QO_PLAN * plan, void * ignore)
QO_PLAN_COMPARE_RESULT qo_plan_cmp (QO_PLAN * a, QO_PLAN * b)
QO_PLAN_COMPARE_RESULT qo_plan_cmp_prefer_covering_index (QO_PLAN * scan_plan_p, QO_PLAN * sort_plan_p)
void qo_plan_compute_cost (QO_PLAN * plan)
void qo_plan_compute_subquery_cost (PT_NODE * subquery, double * subq_cpu_cost, double * subq_io_cost)
void qo_plan_del_ref_func (QO_PLAN * plan, void * ignore)
QO_PLAN * qo_plan_finalize (QO_PLAN * plan)
json_t * qo_plan_follow_print_json (QO_PLAN * plan)
void qo_plan_follow_print_text (FILE * fp, QO_PLAN * plan, int indent)
void qo_plan_fprint (QO_PLAN * plan, FILE * f, int howfar, const char * title)
void qo_plan_free (QO_PLAN * plan)
bool qo_plan_is_orderby_skip_candidate (QO_PLAN * plan)
QO_PLAN_COMPARE_RESULT qo_plan_iscan_terms_cmp (QO_PLAN * a, QO_PLAN * b)
json_t * qo_plan_join_print_json (QO_PLAN * plan)
void qo_plan_join_print_text (FILE * fp, QO_PLAN * plan, int indent)
QO_PLAN * qo_plan_malloc (QO_ENV * env)
QO_PLAN * qo_plan_order_by (QO_PLAN * plan, QO_EQCLASS * order)
void qo_plan_print_analytic_eval (QO_PLAN * plan, FILE * f, int howfar)
void qo_plan_print_costs (QO_PLAN * plan, FILE * f, int howfar)
json_t * qo_plan_print_json (QO_PLAN * plan)
void qo_plan_print_outer_join_terms (QO_PLAN * plan, FILE * f, int howfar)
void qo_plan_print_projected_segs (QO_PLAN * plan, FILE * f, int howfar)
void qo_plan_print_sarged_terms (QO_PLAN * plan, FILE * f, int howfar)
void qo_plan_print_sort_spec (QO_PLAN * plan, FILE * f, int howfar)
void qo_plan_print_sort_spec_helper (PT_NODE * list, bool is_iscan_asc, FILE * f, int howfar)
void qo_plan_print_subqueries (QO_PLAN * plan, FILE * f, int howfar)
void qo_plan_print_text (FILE * fp, QO_PLAN * plan, int indent)
json_t * qo_plan_scan_print_json (QO_PLAN * plan)
void qo_plan_scan_print_text (FILE * fp, QO_PLAN * plan, int indent)
json_t * qo_plan_sort_print_json (QO_PLAN * plan)
void qo_plan_sort_print_text (FILE * fp, QO_PLAN * plan, int indent)
void qo_plan_walk (QO_PLAN * plan, void(*)(QO_PLAN *, void *) child_fn, void * child_data, void(*)(QO_PLAN *, void *) parent_fn, void * parent_data)
void qo_plans_init (QO_ENV * env)
void qo_plans_teardown (QO_ENV * env)
double qo_range_selectivity (QO_ENV * env, PT_NODE * pt_expr)
void qo_scan_fprint (QO_PLAN * plan, FILE * f, int howfar)
void qo_scan_free (QO_PLAN * plan)
void qo_scan_info (QO_PLAN * plan, FILE * f, int howfar)
QO_PLAN * qo_scan_new (QO_INFO * info, QO_NODE * node, QO_SCANMETHOD scan_method)
PT_NODE * qo_search_isnull_key_expr (PARSER_CONTEXT * parser, PT_NODE * tree, void * arg, int * continue_walk)
QO_PLAN * qo_search_partition (QO_PLANNER * planner, QO_PARTITION * partition, QO_EQCLASS * order, BITSET * remaining_subqueries)
QO_INFO * qo_search_partition_join (QO_PLANNER * planner, QO_PARTITION * partition, BITSET * remaining_subqueries)
QO_PLAN * qo_search_planner (QO_PLANNER * planner)
QO_PLAN * qo_seq_scan_new (QO_INFO * info, QO_NODE * node)
int qo_set_orderby_skip (QO_PLAN * plan, void * arg)
void qo_set_use_desc (QO_PLAN * plan)
void qo_sort_cost (QO_PLAN * planp)
void qo_sort_fprint (QO_PLAN * plan, FILE * f, int howfar)
void qo_sort_info (QO_PLAN * plan, FILE * f, int howfar)
QO_PLAN * qo_sort_new (QO_PLAN * root, QO_EQCLASS * order, SORT_TYPE sort_type)
void qo_sort_walk (QO_PLAN * plan, void(*)(QO_PLAN *, void *) child_fn, void * child_data, void(*)(QO_PLAN *, void *) parent_fn, void * parent_data)
void qo_sscan_cost (QO_PLAN * planp)
const char * qo_term_string (QO_TERM * term, char * buf)
QO_PLAN * qo_top_plan_new (QO_PLAN * plan)
void qo_uninit_planvec (QO_PLANVEC * planvec)
int qo_unset_hint_use_desc_idx (QO_PLAN * plan, void * arg)
int qo_unset_multi_range_optimization (QO_PLAN * plan, void * arg)
bool qo_validate_index_attr_notnull (QO_ENV * env, QO_INDEX_ENTRY * index_entryp, PT_NODE * col)
int qo_validate_index_for_groupby (QO_ENV * env, QO_NODE_INDEX_ENTRY * ni_entryp)
int qo_validate_index_for_orderby (QO_ENV * env, QO_NODE_INDEX_ENTRY * ni_entryp)
bool qo_validate_index_term_notnull (QO_ENV * env, QO_INDEX_ENTRY * index_entryp)
int qo_validate_indexes_for_orderby (QO_PLAN * plan, void * arg)
int qo_walk_plan_tree (QO_PLAN * plan, QO_WALK_FUNCTION f, void * arg)
void qo_worst_cost (QO_PLAN * planp)
void qo_worst_fprint (QO_PLAN * plan, FILE * f, int howfar)
void qo_worst_info (QO_PLAN * plan, FILE * f, int howfar)
QO_PLAN * qo_worst_new (QO_ENV * env)
void qo_zero_cost (QO_PLAN * planp)
void sort_partitions (QO_PLANNER * planner)

Macros

Type Name
define DEFAULT_BETWEEN_SELECTIVITY ([**double**](broker__monitor_8c.md#function-timeout)) 0.01
define DEFAULT_COMP_SELECTIVITY ([**double**](broker__monitor_8c.md#function-timeout)) 0.1
define DEFAULT_EQUAL_SELECTIVITY ([**double**](broker__monitor_8c.md#function-timeout)) 0.001
define DEFAULT_EQUIJOIN_SELECTIVITY ([**double**](broker__monitor_8c.md#function-timeout)) 0.001
define DEFAULT_EXISTS_SELECTIVITY ([**double**](broker__monitor_8c.md#function-timeout)) 0.1
define DEFAULT_IN_SELECTIVITY ([**double**](broker__monitor_8c.md#function-timeout)) 0.01
define DEFAULT_NULL_SELECTIVITY ([**double**](broker__monitor_8c.md#function-timeout)) 0.01
define DEFAULT_RANGE_SELECTIVITY ([**double**](broker__monitor_8c.md#function-timeout)) 0.1
define DEFAULT_SELECTIVITY ([**double**](broker__monitor_8c.md#function-timeout)) 0.1
define GUESSED_BIND_LIMIT_CARD 2000 /\* [**When**](broker__monitor_8c.md#function-timeout) limit [**is**](broker__monitor_8c.md#function-timeout) [**a**](broker__monitor_8c.md#function-timeout) [**bind**](broker__monitor_8c.md#function-timeout) variable, [**assume**](broker__monitor_8c.md#function-timeout) [**that**](broker__monitor_8c.md#function-timeout) [**fewer**](broker__monitor_8c.md#function-timeout) rows [**will**](broker__monitor_8c.md#function-timeout) [**be**](broker__monitor_8c.md#function-timeout) assigned. \*/
define HJ_BUILD_CPU_OVERHEAD_FACTOR 30
define HJ_FILE_IO_WEIGHT 0.5 /\* [**Unused**](broker__monitor_8c.md#function-timeout) \*/
define HJ_PROBE_CPU_OVERHEAD_FACTOR 20
define INDENTED_TITLE_FMT [**INDENT\_FMT**](query__planner_8c.md#define-indent_fmt) [**TITLE\_FMT**](query__planner_8c.md#define-title_fmt)
define INDENT_FMT "%\*c"
define INDENT_INCR 4
define ISCAN_IO_HIT_RATIO 0.5
define ISCAN_OID_ACCESS_OVERHEAD 20 /\* [**need**](broker__monitor_8c.md#function-timeout) to [**be**](broker__monitor_8c.md#function-timeout) adjusted \*/
define MJ_CPU_OVERHEAD_FACTOR 20
define QO_CPU_WEIGHT 0.0025
define QO_INFO_INDEX (_M_offset, _bitset) ([**\_M\_offset**](broker__monitor_8c.md#function-timeout) + ([**unsigned**](broker__monitor_8c.md#function-timeout) [**int**](broker__monitor_8c.md#function-timeout))([**BITPATTERN**](query__bitset_8h.md#define-bitpattern)([**\_bitset**](broker__monitor_8c.md#function-timeout)) & planner-&gt;node\_mask))
define QO_IS_LIMIT_NODE (env, node) ([**BITSET\_MEMBER**](query__bitset_8h.md#define-bitset_member) ([**QO\_ENV\_SORT\_LIMIT\_NODES**](query__graph_8h.md#define-qo_env_sort_limit_nodes) ((env)), [**QO\_NODE\_IDX**](query__graph_8h.md#define-qo_node_idx) ((node))))
define QO_PLAN_CMP_CHECK_COST (a, b)
define RBO_CHECK_COST 50
define RBO_CHECK_LIMIT_RATIO 10
define RBO_CHECK_RATIO 1.2
define SORT_SPEC_FMT (spec) /* multi line expression */
define SSCAN_DEFAULT_CARD 100
define TEMP_SETUP_COST 5.0
define TEST_DUMP_PLAN_FOLLOW_COST 0
define TEST_DUMP_PLAN_JOIN_COST 0
define TEST_DUMP_PLAN_SCAN_COST 0
define TEST_DUMP_PLAN_SORT_COST 0
define TEST_HASH_JOIN_ENABLE 0
define TEST_HASH_JOIN_FORCE_ENABLE 0
define TITLE_FMT "%-" [**\_\_STR**](query__planner_8c.md#define-__str)([**TITLE\_WIDTH**](query__planner_8c.md#define-title_width)) "s"
define TITLE_WIDTH 7
define VALID_INNER (plan) /* multi line expression */
define __STR (n) [**\_\_VAL**](query__planner_8c.md#define-__val)(n)
define __VAL (n) #n
define qo_follow_free [**qo\_generic\_free**](query__planner_8c.md#define-qo_generic_free)
define qo_generic_free [**NULL**](freelistheap_8h.md#define-null)
define qo_scan_walk [**qo\_generic\_walk**](query__planner_8c.md#function-qo_generic_walk)
define qo_sort_free [**qo\_generic\_free**](query__planner_8c.md#define-qo_generic_free)
define qo_worst_free [**qo\_generic\_free**](query__planner_8c.md#define-qo_generic_free)
define qo_worst_walk [**qo\_generic\_walk**](query__planner_8c.md#function-qo_generic_walk)

Public Types Documentation

enum JOIN_ORDER_TRY

enum JOIN_ORDER_TRY {
    JOIN_RIGHT_ORDER,
    JOIN_OPPOSITE_ORDER
};

typedef NDV_INFO

typedef struct ndv_info NDV_INFO;

enum PRED_CLASS

enum PRED_CLASS {
    PC_ATTR,
    PC_CONST,
    PC_HOST_VAR,
    PC_SUBQUERY,
    PC_SET,
    PC_OTHER,
    PC_MULTI_ATTR
};

typedef PRED_CLASS

typedef enum PRED_CLASS PRED_CLASS;

typedef QO_WALK_FUNCTION

typedef int(* QO_WALK_FUNCTION) (QO_PLAN *, void *);

Public Attributes Documentation

variable all_vtbls

QO_PLAN_VTBL* all_vtbls[];

Public Static Attributes Documentation

variable infos_allocated

int infos_allocated;

variable infos_deallocated

int infos_deallocated;

variable qo_accumulating_plans

int qo_accumulating_plans;

variable qo_follow_plan_vtbl

QO_PLAN_VTBL qo_follow_plan_vtbl;

variable qo_hash_join_plan_vtbl

QO_PLAN_VTBL qo_hash_join_plan_vtbl;

variable qo_idx_join_plan_vtbl

QO_PLAN_VTBL qo_idx_join_plan_vtbl;

variable qo_index_scan_plan_vtbl

QO_PLAN_VTBL qo_index_scan_plan_vtbl;

variable qo_merge_join_plan_vtbl

QO_PLAN_VTBL qo_merge_join_plan_vtbl;

variable qo_next_tmpfile

int qo_next_tmpfile;

variable qo_nl_join_plan_vtbl

QO_PLAN_VTBL qo_nl_join_plan_vtbl;

variable qo_plan_free_list

QO_PLAN* qo_plan_free_list;

variable qo_plans_allocated

int qo_plans_allocated;

variable qo_plans_deallocated

int qo_plans_deallocated;

variable qo_plans_demalloced

int qo_plans_demalloced;

variable qo_plans_malloced

int qo_plans_malloced;

variable qo_seq_scan_plan_vtbl

QO_PLAN_VTBL qo_seq_scan_plan_vtbl;

variable qo_set_follow_plan_vtbl

QO_PLAN_VTBL qo_set_follow_plan_vtbl;

variable qo_sort_plan_vtbl

QO_PLAN_VTBL qo_sort_plan_vtbl;

variable qo_worst_plan_vtbl

QO_PLAN_VTBL qo_worst_plan_vtbl;

Public Functions Documentation

function qo_check_hjoin_for_parallel_opt

QO_PLAN_PARALLEL_OPT_USE qo_check_hjoin_for_parallel_opt (
    QO_PLAN * plan
) 

function qo_expr_selectivity

double qo_expr_selectivity (
    QO_ENV * env,
    PT_NODE * pt_expr
) 

function qo_has_like_recompile_candidate

int qo_has_like_recompile_candidate (
    QO_PLAN * plan,
    void * arg
) 

function qo_has_sort_limit_subplan

bool qo_has_sort_limit_subplan (
    QO_PLAN * plan
) 

function qo_info_stats

void qo_info_stats (
    FILE * f
) 

function qo_is_all_unique_index_columns_are_equi_terms

bool qo_is_all_unique_index_columns_are_equi_terms (
    QO_PLAN * plan
) 

function qo_is_interesting_order_scan

bool qo_is_interesting_order_scan (
    QO_PLAN * plan
) 

function qo_is_iscan

bool qo_is_iscan (
    QO_PLAN * plan
) 

function qo_is_iscan_from_groupby

bool qo_is_iscan_from_groupby (
    QO_PLAN * plan
) 

function qo_is_iscan_from_orderby

bool qo_is_iscan_from_orderby (
    QO_PLAN * plan
) 

function qo_is_seq_scan

bool qo_is_seq_scan (
    QO_PLAN * plan
) 

function qo_plan_compute_iscan_sort_list

PT_NODE * qo_plan_compute_iscan_sort_list (
    QO_PLAN * root,
    PT_NODE * group_by,
    bool * is_index_w_prefix,
    bool for_min_max_optimize
) 

function qo_plan_discard

void qo_plan_discard (
    QO_PLAN * plan
) 

function qo_plan_dump

void qo_plan_dump (
    QO_PLAN * plan,
    FILE * output
) 

function qo_plan_get_cost_fn

int qo_plan_get_cost_fn (
    const  char * plan_name
) 

function qo_plan_lite_print

void qo_plan_lite_print (
    QO_PLAN * plan,
    FILE * f,
    int howfar
) 

function qo_plan_set_cost_fn

const  char * qo_plan_set_cost_fn (
    const  char * plan_name,
    int fn
) 

function qo_planner_free

void qo_planner_free (
    QO_PLANNER * planner
) 

QO_PLAN * qo_planner_search (
    QO_ENV * env
) 

function qo_plans_stats

void qo_plans_stats (
    FILE * f
) 

function qo_top_plan_print_json

void qo_top_plan_print_json (
    PARSER_CONTEXT * parser,
    xasl_node * xasl,
    PT_NODE * select,
    QO_PLAN * plan
) 

function qo_top_plan_print_text

void qo_top_plan_print_text (
    PARSER_CONTEXT * parser,
    xasl_node * xasl,
    PT_NODE * select,
    QO_PLAN * plan
) 

Public Static Functions Documentation

function log3

static double log3 (
    double n
) 

function planner_nodeset_join_cost

static double planner_nodeset_join_cost (
    QO_PLANNER * planner,
    BITSET * nodeset
) 

function planner_permutate

static void planner_permutate (
    QO_PLANNER * planner,
    QO_PARTITION * partition,
    PT_HINT_ENUM hint,
    QO_NODE * prev_head_node,
    BITSET * visited_nodes,
    BITSET * visited_rel_nodes,
    BITSET * visited_terms,
    BITSET * nested_path_nodes,
    BITSET * remaining_nodes,
    BITSET * remaining_terms,
    BITSET * remaining_subqueries,
    int num_path_inner,
    int * node_idxp
) 

function planner_visit_node

static void planner_visit_node (
    QO_PLANNER * planner,
    QO_PARTITION * partition,
    PT_HINT_ENUM hint,
    QO_NODE * head_node,
    QO_NODE * tail_node,
    BITSET * visited_nodes,
    BITSET * visited_rel_nodes,
    BITSET * visited_terms,
    BITSET * nested_path_nodes,
    BITSET * remaining_nodes,
    BITSET * remaining_terms,
    BITSET * remaining_subqueries,
    int num_path_inner
) 

function qo_all_some_in_selectivity

static double qo_all_some_in_selectivity (
    QO_ENV * env,
    PT_NODE * pt_expr
) 

function qo_alloc_info

static QO_INFO * qo_alloc_info (
    QO_PLANNER * planner,
    BITSET * nodes,
    BITSET * terms,
    BITSET * eqclasses,
    double cardinality,
    double total_rows
) 

function qo_alloc_planner

static QO_PLANNER * qo_alloc_planner (
    QO_ENV * env
) 

function qo_and_selectivity

static double qo_and_selectivity (
    QO_ENV * env,
    double lhs_sel,
    double rhs_sel
) 

function qo_between_selectivity

static double qo_between_selectivity (
    QO_ENV * env,
    PT_NODE * pt_expr
) 

function qo_can_apply_limit_card

static bool qo_can_apply_limit_card (
    QO_ENV * env
) 

function qo_check_groupby_skip_descending

static bool qo_check_groupby_skip_descending (
    QO_PLAN * plan,
    PT_NODE * list
) 

function qo_check_like_recompile_candidate

static int qo_check_like_recompile_candidate (
    QO_PLAN * plan,
    void * arg
) 

function qo_check_new_best_plan_on_info

static bool qo_check_new_best_plan_on_info (
    QO_INFO * info,
    QO_PLAN * plan
) 

function qo_check_orderby_skip_descending

static bool qo_check_orderby_skip_descending (
    QO_PLAN * plan
) 

function qo_check_plan_on_info

static int qo_check_plan_on_info (
    QO_INFO * info,
    QO_PLAN * plan
) 

function qo_check_planvec

static QO_PLAN_COMPARE_RESULT qo_check_planvec (
    QO_PLANVEC * planvec,
    QO_PLAN * plan
) 

function qo_check_skip_term

static bool qo_check_skip_term (
    QO_ENV * env,
    BITSET visited_segs,
    QO_TERM * term,
    BITSET * visited_terms,
    BITSET * cur_visited_terms
) 

function qo_classify

static PRED_CLASS qo_classify (
    PT_NODE * attr
) 

function qo_clean_planner

static void qo_clean_planner (
    QO_PLANNER * planner
) 

function qo_cmp_planvec

static QO_PLAN_COMPARE_RESULT qo_cmp_planvec (
    QO_PLANVEC * planvec,
    QO_PLAN * plan
) 

function qo_combine_partitions

static QO_PLAN * qo_combine_partitions (
    QO_PLANNER * planner,
    BITSET * reamining_subqueries
) 

function qo_comp_selectivity

static double qo_comp_selectivity (
    QO_ENV * env,
    PT_NODE * pt_expr
) 

function qo_compute_projected_segs

static void qo_compute_projected_segs (
    QO_PLANNER * planner,
    BITSET * nodes,
    BITSET * terms,
    BITSET * projected
) 

function qo_compute_projected_size

static int qo_compute_projected_size (
    QO_PLANNER * planner,
    BITSET * segset
) 

function qo_cp_new

static QO_PLAN * qo_cp_new (
    QO_INFO * info,
    QO_PLAN * outer,
    QO_PLAN * inner,
    BITSET * sarged_terms,
    BITSET * pinned_subqueries
) 

function qo_detach_info

static void qo_detach_info (
    QO_INFO * info
) 

function qo_dump_info

static void qo_dump_info (
    QO_INFO * info,
    FILE * f
) 

function qo_dump_planner_info

static void qo_dump_planner_info (
    QO_PLANNER * planner,
    QO_PARTITION * partition,
    FILE * f
) 

function qo_dump_planvec

static void qo_dump_planvec (
    QO_PLANVEC * planvec,
    FILE * f,
    int indent
) 

function qo_equal_selectivity

static double qo_equal_selectivity (
    QO_ENV * env,
    PT_NODE * pt_expr
) 

function qo_estimate_ndv

static double qo_estimate_ndv (
    double N,
    double p,
    double n
) 

function qo_estimate_ngroups

static void qo_estimate_ngroups (
    QO_PLAN * plan,
    SORT_TYPE sort_type
) 

function qo_examine_correlated_index

static int qo_examine_correlated_index (
    QO_INFO * info,
    JOIN_TYPE join_type,
    QO_INFO * outer,
    QO_INFO * inner,
    BITSET * afj_terms,
    BITSET * sarged_terms,
    BITSET * pinned_subqueries
) 

function qo_examine_follow

static int qo_examine_follow (
    QO_INFO * info,
    QO_TERM * path_term,
    QO_INFO * head_info,
    BITSET * sarged_terms,
    BITSET * pinned_subqueries
) 

function qo_examine_hash_join

static int qo_examine_hash_join (
    QO_INFO * info,
    JOIN_TYPE join_type,
    QO_INFO * outer,
    QO_INFO * inner,
    BITSET * hash_join_terms,
    BITSET * duj_terms,
    BITSET * afj_terms,
    BITSET * sarged_terms,
    BITSET * pinned_subqueries
) 

function qo_examine_idx_join

static int qo_examine_idx_join (
    QO_INFO * info,
    JOIN_TYPE join_type,
    QO_INFO * outer,
    QO_INFO * inner,
    BITSET * afj_terms,
    BITSET * sarged_terms,
    BITSET * pinned_subqueries
) 

function qo_examine_merge_join

static int qo_examine_merge_join (
    QO_INFO * info,
    JOIN_TYPE join_type,
    QO_INFO * outer,
    QO_INFO * inner,
    BITSET * sm_join_terms,
    BITSET * duj_terms,
    BITSET * afj_terms,
    BITSET * sarged_terms,
    BITSET * pinned_subqueries
) 

function qo_examine_nl_join

static int qo_examine_nl_join (
    QO_INFO * info,
    JOIN_TYPE join_type,
    QO_INFO * outer,
    QO_INFO * inner,
    BITSET * nl_join_terms,
    BITSET * duj_terms,
    BITSET * afj_terms,
    BITSET * sarged_terms,
    BITSET * pinned_subqueries,
    int idx_join_plan_n,
    BITSET * hash_terms
) 

function qo_find_best_nljoin_inner_plan_on_info

static QO_PLAN * qo_find_best_nljoin_inner_plan_on_info (
    QO_PLAN * outer,
    QO_INFO * info,
    JOIN_TYPE join_type,
    int idx_join_plan_n
) 

function qo_find_best_plan_on_info

static QO_PLAN * qo_find_best_plan_on_info (
    QO_INFO * info,
    QO_EQCLASS * order,
    double n
) 

function qo_find_best_plan_on_planvec

static QO_PLAN * qo_find_best_plan_on_planvec (
    QO_PLANVEC * planvec,
    double n
) 

function qo_follow_cost

static void qo_follow_cost (
    QO_PLAN * planp
) 

function qo_follow_fprint

static void qo_follow_fprint (
    QO_PLAN * plan,
    FILE * f,
    int howfar
) 

function qo_follow_info

static void qo_follow_info (
    QO_PLAN * plan,
    FILE * f,
    int howfar
) 

function qo_follow_new

static QO_PLAN * qo_follow_new (
    QO_INFO * info,
    QO_PLAN * head_plan,
    QO_TERM * path_term,
    BITSET * sarged_terms,
    BITSET * pinned_subqueries
) 

function qo_follow_walk

static void qo_follow_walk (
    QO_PLAN * plan,
    void (*)( QO_PLAN *, void *) child_fn,
    void * child_data,
    void (*)( QO_PLAN *, void *) parent_fn,
    void * parent_data
) 

function qo_free_info

static void qo_free_info (
    QO_INFO * info
) 

function qo_generate_index_scan

static int qo_generate_index_scan (
    QO_INFO * infop,
    QO_NODE * nodep,
    QO_NODE_INDEX_ENTRY * ni_entryp,
    int nsegs
) 

function qo_generate_join_index_scan

static int qo_generate_join_index_scan (
    QO_INFO * infop,
    JOIN_TYPE join_type,
    QO_PLAN * outer_plan,
    QO_INFO * inner,
    QO_NODE * nodep,
    QO_NODE_INDEX_ENTRY * ni_entryp,
    BITSET * indexable_terms,
    BITSET * afj_terms,
    BITSET * sarged_terms,
    BITSET * pinned_subqueries
) 

function qo_generate_loose_index_scan

static int qo_generate_loose_index_scan (
    QO_INFO * infop,
    QO_NODE * nodep,
    QO_NODE_INDEX_ENTRY * ni_entryp
) 

function qo_generate_seq_scan

static void qo_generate_seq_scan (
    QO_INFO * infop,
    QO_NODE * nodep
) 

function qo_generate_sort_limit_plan

static int qo_generate_sort_limit_plan (
    QO_ENV * env,
    QO_INFO * infop,
    QO_PLAN * subplan
) 

function qo_generic_walk

static void qo_generic_walk (
    QO_PLAN * plan,
    void (*)( QO_PLAN *, void *) child_fn,
    void * child_data,
    void (*)( QO_PLAN *, void *) parent_fn,
    void * parent_data
) 

function qo_get_col_product_ndv

static PT_NODE * qo_get_col_product_ndv (
    PARSER_CONTEXT * parser,
    PT_NODE * tree,
    void * arg,
    int * continue_walk
) 

function qo_get_group_ndv

static int qo_get_group_ndv (
    QO_PLAN * plan,
    SORT_TYPE sort_type
) 

function qo_get_term_hit_prob

static void qo_get_term_hit_prob (
    QO_TERM * term,
    QO_INFO * head_info,
    QO_INFO * tail_info,
    QO_ENV * env,
    double * out_head_factor,
    double * out_tail_factor
) 

function qo_group_by_skip_plans_cmp

static QO_PLAN_COMPARE_RESULT qo_group_by_skip_plans_cmp (
    QO_PLAN * a,
    QO_PLAN * b
) 

function qo_has_is_not_null_term

static int qo_has_is_not_null_term (
    QO_NODE * node
) 

function qo_hjoin_cost

static void qo_hjoin_cost (
    QO_PLAN * plan_p
) 

function qo_hjoin_fprint

static void qo_hjoin_fprint (
    QO_PLAN * plan,
    FILE * f,
    int howfar
) 

function qo_index_cardinality

static int qo_index_cardinality (
    QO_ENV * env,
    PT_NODE * attr
) 

function qo_index_cardinality_with_dedup

static int qo_index_cardinality_with_dedup (
    QO_ENV * env,
    PT_NODE * attr,
    BITSET * seg_bitset
) 

function qo_index_covering_plans_cmp

static QO_PLAN_COMPARE_RESULT qo_index_covering_plans_cmp (
    QO_PLAN * a,
    QO_PLAN * b
) 

function qo_index_has_bit_attr

static bool qo_index_has_bit_attr (
    QO_INDEX_ENTRY * index_entryp
) 

function qo_index_scan_new

static QO_PLAN * qo_index_scan_new (
    QO_INFO * info,
    QO_NODE * node,
    QO_NODE_INDEX_ENTRY * ni_entry,
    QO_SCANMETHOD scan_method,
    BITSET * range_terms,
    BITSET * indexable_terms
) 

function qo_info_nodes_init

static void qo_info_nodes_init (
    QO_ENV * env
) 

function qo_init_planvec

static void qo_init_planvec (
    QO_PLANVEC * planvec
) 

function qo_is_sort_limit

static bool qo_is_sort_limit (
    QO_PLAN * plan
) 

function qo_iscan_cost

static void qo_iscan_cost (
    QO_PLAN * planp
) 

function qo_join_fprint

static void qo_join_fprint (
    QO_PLAN * plan,
    FILE * f,
    int howfar
) 

function qo_join_free

static void qo_join_free (
    QO_PLAN * plan
) 

function qo_join_info

static void qo_join_info (
    QO_PLAN * plan,
    FILE * f,
    int howfar
) 

function qo_join_new

static QO_PLAN * qo_join_new (
    QO_INFO * info,
    JOIN_TYPE join_type,
    QO_JOINMETHOD join_method,
    QO_PLAN * outer,
    QO_PLAN * inner,
    BITSET * join_terms,
    BITSET * duj_terms,
    BITSET * afj_terms,
    BITSET * sarged_terms,
    BITSET * pinned_subqueries,
    BITSET * hash_terms
) 

function qo_join_walk

static void qo_join_walk (
    QO_PLAN * plan,
    void (*)( QO_PLAN *, void *) child_fn,
    void * child_data,
    void (*)( QO_PLAN *, void *) parent_fn,
    void * parent_data
) 

function qo_mjoin_cost

static void qo_mjoin_cost (
    QO_PLAN * planp
) 

function qo_multi_range_opt_plans_cmp

static QO_PLAN_COMPARE_RESULT qo_multi_range_opt_plans_cmp (
    QO_PLAN * a,
    QO_PLAN * b
) 

function qo_nljoin_cost

static void qo_nljoin_cost (
    QO_PLAN * planp
) 

function qo_not_selectivity

static double qo_not_selectivity (
    QO_ENV * env,
    double sel
) 

function qo_or_selectivity

static double qo_or_selectivity (
    QO_ENV * env,
    double lhs_sel,
    double rhs_sel
) 

function qo_order_by_skip_plans_cmp

static QO_PLAN_COMPARE_RESULT qo_order_by_skip_plans_cmp (
    QO_PLAN * a,
    QO_PLAN * b
) 

function qo_plan_add_to_free_list

static void qo_plan_add_to_free_list (
    QO_PLAN * plan,
    void * ignore
) 

function qo_plan_cmp

static QO_PLAN_COMPARE_RESULT qo_plan_cmp (
    QO_PLAN * a,
    QO_PLAN * b
) 

function qo_plan_cmp_prefer_covering_index

static QO_PLAN_COMPARE_RESULT qo_plan_cmp_prefer_covering_index (
    QO_PLAN * scan_plan_p,
    QO_PLAN * sort_plan_p
) 

function qo_plan_compute_cost

static void qo_plan_compute_cost (
    QO_PLAN * plan
) 

function qo_plan_compute_subquery_cost

static void qo_plan_compute_subquery_cost (
    PT_NODE * subquery,
    double * subq_cpu_cost,
    double * subq_io_cost
) 

function qo_plan_del_ref_func

static void qo_plan_del_ref_func (
    QO_PLAN * plan,
    void * ignore
) 

function qo_plan_finalize

static QO_PLAN * qo_plan_finalize (
    QO_PLAN * plan
) 

function qo_plan_follow_print_json

static json_t * qo_plan_follow_print_json (
    QO_PLAN * plan
) 

function qo_plan_follow_print_text

static void qo_plan_follow_print_text (
    FILE * fp,
    QO_PLAN * plan,
    int indent
) 

function qo_plan_fprint

static void qo_plan_fprint (
    QO_PLAN * plan,
    FILE * f,
    int howfar,
    const  char * title
) 

function qo_plan_free

static void qo_plan_free (
    QO_PLAN * plan
) 

function qo_plan_is_orderby_skip_candidate

static bool qo_plan_is_orderby_skip_candidate (
    QO_PLAN * plan
) 

function qo_plan_iscan_terms_cmp

static QO_PLAN_COMPARE_RESULT qo_plan_iscan_terms_cmp (
    QO_PLAN * a,
    QO_PLAN * b
) 

function qo_plan_join_print_json

static json_t * qo_plan_join_print_json (
    QO_PLAN * plan
) 

function qo_plan_join_print_text

static void qo_plan_join_print_text (
    FILE * fp,
    QO_PLAN * plan,
    int indent
) 

function qo_plan_malloc

static QO_PLAN * qo_plan_malloc (
    QO_ENV * env
) 

function qo_plan_order_by

static QO_PLAN * qo_plan_order_by (
    QO_PLAN * plan,
    QO_EQCLASS * order
) 

function qo_plan_print_analytic_eval

static void qo_plan_print_analytic_eval (
    QO_PLAN * plan,
    FILE * f,
    int howfar
) 

function qo_plan_print_costs

static void qo_plan_print_costs (
    QO_PLAN * plan,
    FILE * f,
    int howfar
) 

function qo_plan_print_json

static json_t * qo_plan_print_json (
    QO_PLAN * plan
) 

function qo_plan_print_outer_join_terms

static void qo_plan_print_outer_join_terms (
    QO_PLAN * plan,
    FILE * f,
    int howfar
) 

function qo_plan_print_projected_segs

static void qo_plan_print_projected_segs (
    QO_PLAN * plan,
    FILE * f,
    int howfar
) 

function qo_plan_print_sarged_terms

static void qo_plan_print_sarged_terms (
    QO_PLAN * plan,
    FILE * f,
    int howfar
) 

function qo_plan_print_sort_spec

static void qo_plan_print_sort_spec (
    QO_PLAN * plan,
    FILE * f,
    int howfar
) 

function qo_plan_print_sort_spec_helper

static void qo_plan_print_sort_spec_helper (
    PT_NODE * list,
    bool is_iscan_asc,
    FILE * f,
    int howfar
) 

function qo_plan_print_subqueries

static void qo_plan_print_subqueries (
    QO_PLAN * plan,
    FILE * f,
    int howfar
) 

function qo_plan_print_text

static void qo_plan_print_text (
    FILE * fp,
    QO_PLAN * plan,
    int indent
) 

function qo_plan_scan_print_json

static json_t * qo_plan_scan_print_json (
    QO_PLAN * plan
) 

function qo_plan_scan_print_text

static void qo_plan_scan_print_text (
    FILE * fp,
    QO_PLAN * plan,
    int indent
) 

function qo_plan_sort_print_json

static json_t * qo_plan_sort_print_json (
    QO_PLAN * plan
) 

function qo_plan_sort_print_text

static void qo_plan_sort_print_text (
    FILE * fp,
    QO_PLAN * plan,
    int indent
) 

function qo_plan_walk

static void qo_plan_walk (
    QO_PLAN * plan,
    void (*)( QO_PLAN *, void *) child_fn,
    void * child_data,
    void (*)( QO_PLAN *, void *) parent_fn,
    void * parent_data
) 

function qo_plans_init

static void qo_plans_init (
    QO_ENV * env
) 

function qo_plans_teardown

static void qo_plans_teardown (
    QO_ENV * env
) 

function qo_range_selectivity

static double qo_range_selectivity (
    QO_ENV * env,
    PT_NODE * pt_expr
) 

function qo_scan_fprint

static void qo_scan_fprint (
    QO_PLAN * plan,
    FILE * f,
    int howfar
) 

function qo_scan_free

static void qo_scan_free (
    QO_PLAN * plan
) 

function qo_scan_info

static void qo_scan_info (
    QO_PLAN * plan,
    FILE * f,
    int howfar
) 

function qo_scan_new

static QO_PLAN * qo_scan_new (
    QO_INFO * info,
    QO_NODE * node,
    QO_SCANMETHOD scan_method
) 

function qo_search_isnull_key_expr

static PT_NODE * qo_search_isnull_key_expr (
    PARSER_CONTEXT * parser,
    PT_NODE * tree,
    void * arg,
    int * continue_walk
) 

function qo_search_partition

static QO_PLAN * qo_search_partition (
    QO_PLANNER * planner,
    QO_PARTITION * partition,
    QO_EQCLASS * order,
    BITSET * remaining_subqueries
) 

function qo_search_partition_join

static QO_INFO * qo_search_partition_join (
    QO_PLANNER * planner,
    QO_PARTITION * partition,
    BITSET * remaining_subqueries
) 

function qo_search_planner

static QO_PLAN * qo_search_planner (
    QO_PLANNER * planner
) 

function qo_seq_scan_new

static QO_PLAN * qo_seq_scan_new (
    QO_INFO * info,
    QO_NODE * node
) 

function qo_set_orderby_skip

static int qo_set_orderby_skip (
    QO_PLAN * plan,
    void * arg
) 

function qo_set_use_desc

static void qo_set_use_desc (
    QO_PLAN * plan
) 

function qo_sort_cost

static void qo_sort_cost (
    QO_PLAN * planp
) 

function qo_sort_fprint

static void qo_sort_fprint (
    QO_PLAN * plan,
    FILE * f,
    int howfar
) 

function qo_sort_info

static void qo_sort_info (
    QO_PLAN * plan,
    FILE * f,
    int howfar
) 

function qo_sort_new

static QO_PLAN * qo_sort_new (
    QO_PLAN * root,
    QO_EQCLASS * order,
    SORT_TYPE sort_type
) 

function qo_sort_walk

static void qo_sort_walk (
    QO_PLAN * plan,
    void (*)( QO_PLAN *, void *) child_fn,
    void * child_data,
    void (*)( QO_PLAN *, void *) parent_fn,
    void * parent_data
) 

function qo_sscan_cost

static void qo_sscan_cost (
    QO_PLAN * planp
) 

function qo_term_string

static const  char * qo_term_string (
    QO_TERM * term,
    char * buf
) 

function qo_top_plan_new

static QO_PLAN * qo_top_plan_new (
    QO_PLAN * plan
) 

function qo_uninit_planvec

static void qo_uninit_planvec (
    QO_PLANVEC * planvec
) 

function qo_unset_hint_use_desc_idx

static int qo_unset_hint_use_desc_idx (
    QO_PLAN * plan,
    void * arg
) 

function qo_unset_multi_range_optimization

static int qo_unset_multi_range_optimization (
    QO_PLAN * plan,
    void * arg
) 

function qo_validate_index_attr_notnull

static bool qo_validate_index_attr_notnull (
    QO_ENV * env,
    QO_INDEX_ENTRY * index_entryp,
    PT_NODE * col
) 

function qo_validate_index_for_groupby

static int qo_validate_index_for_groupby (
    QO_ENV * env,
    QO_NODE_INDEX_ENTRY * ni_entryp
) 

function qo_validate_index_for_orderby

static int qo_validate_index_for_orderby (
    QO_ENV * env,
    QO_NODE_INDEX_ENTRY * ni_entryp
) 

function qo_validate_index_term_notnull

static bool qo_validate_index_term_notnull (
    QO_ENV * env,
    QO_INDEX_ENTRY * index_entryp
) 

function qo_validate_indexes_for_orderby

static int qo_validate_indexes_for_orderby (
    QO_PLAN * plan,
    void * arg
) 

function qo_walk_plan_tree

static int qo_walk_plan_tree (
    QO_PLAN * plan,
    QO_WALK_FUNCTION f,
    void * arg
) 

function qo_worst_cost

static void qo_worst_cost (
    QO_PLAN * planp
) 

function qo_worst_fprint

static void qo_worst_fprint (
    QO_PLAN * plan,
    FILE * f,
    int howfar
) 

function qo_worst_info

static void qo_worst_info (
    QO_PLAN * plan,
    FILE * f,
    int howfar
) 

function qo_worst_new

static QO_PLAN * qo_worst_new (
    QO_ENV * env
) 

function qo_zero_cost

static void qo_zero_cost (
    QO_PLAN * planp
) 

function sort_partitions

static void sort_partitions (
    QO_PLANNER * planner
) 

Macro Definition Documentation

define DEFAULT_BETWEEN_SELECTIVITY

#define DEFAULT_BETWEEN_SELECTIVITY `( double ) 0.01`

define DEFAULT_COMP_SELECTIVITY

#define DEFAULT_COMP_SELECTIVITY `( double ) 0.1`

define DEFAULT_EQUAL_SELECTIVITY

#define DEFAULT_EQUAL_SELECTIVITY `( double ) 0.001`

define DEFAULT_EQUIJOIN_SELECTIVITY

#define DEFAULT_EQUIJOIN_SELECTIVITY `( double ) 0.001`

define DEFAULT_EXISTS_SELECTIVITY

#define DEFAULT_EXISTS_SELECTIVITY `( double ) 0.1`

define DEFAULT_IN_SELECTIVITY

#define DEFAULT_IN_SELECTIVITY `( double ) 0.01`

define DEFAULT_NULL_SELECTIVITY

#define DEFAULT_NULL_SELECTIVITY `( double ) 0.01`

define DEFAULT_RANGE_SELECTIVITY

#define DEFAULT_RANGE_SELECTIVITY `( double ) 0.1`

define DEFAULT_SELECTIVITY

#define DEFAULT_SELECTIVITY `( double ) 0.1`

define GUESSED_BIND_LIMIT_CARD

#define GUESSED_BIND_LIMIT_CARD `2000   /* When limit is  a  bind variable, assume  that  fewer rows will  be assigned. */`

define HJ_BUILD_CPU_OVERHEAD_FACTOR

#define HJ_BUILD_CPU_OVERHEAD_FACTOR `30`

define HJ_FILE_IO_WEIGHT

#define HJ_FILE_IO_WEIGHT `0.5  /* Unused */`

define HJ_PROBE_CPU_OVERHEAD_FACTOR

#define HJ_PROBE_CPU_OVERHEAD_FACTOR `20`

define INDENTED_TITLE_FMT

#define INDENTED_TITLE_FMT `INDENT_FMT  TITLE_FMT`

define INDENT_FMT

#define INDENT_FMT `"%*c"`

define INDENT_INCR

#define INDENT_INCR `4`

define ISCAN_IO_HIT_RATIO

#define ISCAN_IO_HIT_RATIO `0.5`

define ISCAN_OID_ACCESS_OVERHEAD

#define ISCAN_OID_ACCESS_OVERHEAD `20   /* need to be adjusted */`

define MJ_CPU_OVERHEAD_FACTOR

#define MJ_CPU_OVERHEAD_FACTOR `20`

define QO_CPU_WEIGHT

#define QO_CPU_WEIGHT `0.0025`

define QO_INFO_INDEX

#define QO_INFO_INDEX (
    _M_offset,
    _bitset
) `( _M_offset + ( unsigned  int )( BITPATTERN ( _bitset ) & planner->node_mask))`

define QO_IS_LIMIT_NODE

#define QO_IS_LIMIT_NODE (
    env,
    node
) `( BITSET_MEMBER ( QO_ENV_SORT_LIMIT_NODES ((env)), QO_NODE_IDX ((node))))`

define QO_PLAN_CMP_CHECK_COST

#define QO_PLAN_CMP_CHECK_COST (
    a,
    b
) 

define RBO_CHECK_COST

#define RBO_CHECK_COST `50`

define RBO_CHECK_LIMIT_RATIO

#define RBO_CHECK_LIMIT_RATIO `10`

define RBO_CHECK_RATIO

#define RBO_CHECK_RATIO `1.2`

define SORT_SPEC_FMT

#define SORT_SPEC_FMT (
    spec
) `/* multi line expression */`

define SSCAN_DEFAULT_CARD

#define SSCAN_DEFAULT_CARD `100`

define TEMP_SETUP_COST

#define TEMP_SETUP_COST `5.0`

define TEST_DUMP_PLAN_FOLLOW_COST

#define TEST_DUMP_PLAN_FOLLOW_COST `0`

define TEST_DUMP_PLAN_JOIN_COST

#define TEST_DUMP_PLAN_JOIN_COST `0`

define TEST_DUMP_PLAN_SCAN_COST

#define TEST_DUMP_PLAN_SCAN_COST `0`

define TEST_DUMP_PLAN_SORT_COST

#define TEST_DUMP_PLAN_SORT_COST `0`

define TEST_HASH_JOIN_ENABLE

#define TEST_HASH_JOIN_ENABLE `0`

define TEST_HASH_JOIN_FORCE_ENABLE

#define TEST_HASH_JOIN_FORCE_ENABLE `0`

define TITLE_FMT

#define TITLE_FMT `"%-" __STR ( TITLE_WIDTH ) "s"`

define TITLE_WIDTH

#define TITLE_WIDTH `7`

define VALID_INNER

#define VALID_INNER (
    plan
) `/* multi line expression */`

define __STR

#define __STR (
    n
) `__VAL (n)`

define __VAL

#define __VAL (
    n
) `#n`

define qo_follow_free

#define qo_follow_free `qo_generic_free`

define qo_generic_free

#define qo_generic_free `NULL`

define qo_scan_walk

#define qo_scan_walk `qo_generic_walk`

define qo_sort_free

#define qo_sort_free `qo_generic_free`

define qo_worst_free

#define qo_worst_free `qo_generic_free`

define qo_worst_walk

#define qo_worst_walk `qo_generic_walk`


The documentation for this class was generated from the following file cubrid/src/optimizer/query_planner.c