CUBRID Engine
latest
|
#include <stdarg.h>
#include <assert.h>
#include "error_manager.h"
#include "memory_alloc.h"
#include "parser.h"
#include "release_string.h"
Go to the source code of this file.
Classes | |
struct | qo_summary |
struct | QO_ATTR_CUM_STATS |
struct | qo_limit_info |
Macros | |
#define | UNEXPECTED_CASE 0 |
#define | UNREACHABLE 0 |
#define | QO_ASSERT(env, cond) |
#define | QO_ABORT(env) qo_abort((env), __FILE__, __LINE__) |
#define | QO_WARN(code) |
#define | QO_WARN1(code, x) |
#define | QO_ERROR(code) |
#define | QO_ERROR1(code, x) |
#define | QO_ERROR2(code, x, y) |
#define | OPT_LEVEL(level) ((level) & 0xff) |
#define | OPTIMIZATION_ENABLED(level) (OPT_LEVEL(level) != 0) |
#define | PLAN_DUMP_ENABLED(level) ((level) >= 0x100) |
#define | SIMPLE_DUMP(level) ((level) & 0x100) |
#define | DETAILED_DUMP(level) ((level) & 0x200) |
Typedefs | |
typedef struct qo_env | QO_ENV |
typedef struct qo_node | QO_NODE |
typedef struct qo_segment | QO_SEGMENT |
typedef struct qo_term | QO_TERM |
typedef struct qo_eqclass | QO_EQCLASS |
typedef struct qo_subquery | QO_SUBQUERY |
typedef struct qo_planner | QO_PLANNER |
typedef struct qo_info | QO_INFO |
typedef struct qo_partition | QO_PARTITION |
typedef struct qo_class_info | QO_CLASS_INFO |
typedef struct qo_attr_info | QO_ATTR_INFO |
typedef struct qo_summary | QO_SUMMARY |
typedef struct qo_index | QO_INDEX |
typedef struct qo_index_entry | QO_INDEX_ENTRY |
typedef struct qo_node_index | QO_NODE_INDEX |
typedef struct qo_node_index_entry | QO_NODE_INDEX_ENTRY |
typedef struct qo_index_xasl_info | QO_INDEX_XASL_INFO |
typedef struct qo_using_index | QO_USING_INDEX |
typedef struct qo_using_index_entry | QO_USING_INDEX_ENTRY |
typedef struct bitset | BITSET |
typedef struct qo_plan | QO_PLAN |
typedef struct qo_xasl_index_info | QO_XASL_INDEX_INFO |
typedef struct qo_limit_info | QO_LIMIT_INFO |
Enumerations | |
enum | QO_PARAM { QO_PARAM_LEVEL, QO_PARAM_COST } |
#define DETAILED_DUMP | ( | level | ) | ((level) & 0x200) |
Definition at line 86 of file optimizer.h.
Referenced by csql_set_plan_dump(), pt_plan_query(), qo_optimize_helper(), and qo_plan_dump().
#define OPT_LEVEL | ( | level | ) | ((level) & 0xff) |
Definition at line 82 of file optimizer.h.
#define OPTIMIZATION_ENABLED | ( | level | ) | (OPT_LEVEL(level) != 0) |
Definition at line 83 of file optimizer.h.
Referenced by pt_make_connect_by_proc(), pt_print_select(), qo_can_generate_single_table_connect_by(), qo_optimize_queries(), and qo_optimize_query().
#define PLAN_DUMP_ENABLED | ( | level | ) | ((level) >= 0x100) |
Definition at line 84 of file optimizer.h.
Referenced by csql_set_plan_dump(), qo_optimize_helper(), and qo_to_xasl().
#define QO_ABORT | ( | env | ) | qo_abort((env), __FILE__, __LINE__) |
Definition at line 59 of file optimizer.h.
Referenced by qo_analyze_term(), and qo_discover_partitions().
#define QO_ASSERT | ( | env, | |
cond | |||
) |
Definition at line 52 of file optimizer.h.
Referenced by build_graph_for_entity(), gen_inner(), get_local_subqueries(), lookup_node(), planner_visit_node(), qo_add_dep_term(), qo_add_dummy_join_term(), qo_add_node(), qo_add_term(), qo_analyze_term(), qo_and_selectivity(), qo_between_selectivity(), qo_classify_outerjoin_terms(), qo_discover_edges(), qo_eqclass_new(), qo_eqclass_wrt(), qo_expr_selectivity(), qo_follow_new(), qo_get_attr_info(), qo_get_attr_info_func_index(), qo_get_class_info(), qo_get_ils_prefix_length(), qo_get_index_info(), qo_index_cardinality(), qo_insert_segment(), qo_is_coverage_index(), qo_is_iss_index(), qo_join_new(), qo_join_segment(), qo_not_selectivity(), qo_optimize_helper(), qo_or_selectivity(), qo_range_selectivity(), and qo_top_plan_new().
#define QO_ERROR | ( | code | ) |
Definition at line 70 of file optimizer.h.
#define QO_ERROR1 | ( | code, | |
x | |||
) |
Definition at line 71 of file optimizer.h.
#define QO_ERROR2 | ( | code, | |
x, | |||
y | |||
) |
Definition at line 72 of file optimizer.h.
#define QO_WARN | ( | code | ) |
Definition at line 68 of file optimizer.h.
#define QO_WARN1 | ( | code, | |
x | |||
) |
Definition at line 69 of file optimizer.h.
#define SIMPLE_DUMP | ( | level | ) | ((level) & 0x100) |
Definition at line 85 of file optimizer.h.
Referenced by csql_set_plan_dump(), pt_plan_query(), and qo_plan_dump().
#define UNEXPECTED_CASE 0 |
Definition at line 49 of file optimizer.h.
Referenced by planner_visit_node().
#define UNREACHABLE 0 |
Definition at line 50 of file optimizer.h.
Definition at line 107 of file optimizer.h.
typedef struct qo_attr_info QO_ATTR_INFO |
Definition at line 98 of file optimizer.h.
typedef struct qo_class_info QO_CLASS_INFO |
Definition at line 97 of file optimizer.h.
Definition at line 88 of file optimizer.h.
typedef struct qo_eqclass QO_EQCLASS |
Definition at line 92 of file optimizer.h.
Definition at line 100 of file optimizer.h.
typedef struct qo_index_entry QO_INDEX_ENTRY |
Definition at line 101 of file optimizer.h.
typedef struct qo_index_xasl_info QO_INDEX_XASL_INFO |
Definition at line 104 of file optimizer.h.
Definition at line 95 of file optimizer.h.
typedef struct qo_limit_info QO_LIMIT_INFO |
Definition at line 89 of file optimizer.h.
typedef struct qo_node_index QO_NODE_INDEX |
Definition at line 102 of file optimizer.h.
typedef struct qo_node_index_entry QO_NODE_INDEX_ENTRY |
Definition at line 103 of file optimizer.h.
typedef struct qo_partition QO_PARTITION |
Definition at line 96 of file optimizer.h.
Definition at line 132 of file optimizer.h.
typedef struct qo_planner QO_PLANNER |
Definition at line 94 of file optimizer.h.
typedef struct qo_segment QO_SEGMENT |
Definition at line 90 of file optimizer.h.
typedef struct qo_subquery QO_SUBQUERY |
Definition at line 93 of file optimizer.h.
typedef struct qo_summary QO_SUMMARY |
Definition at line 99 of file optimizer.h.
Definition at line 91 of file optimizer.h.
typedef struct qo_using_index QO_USING_INDEX |
Definition at line 105 of file optimizer.h.
typedef struct qo_using_index_entry QO_USING_INDEX_ENTRY |
Definition at line 106 of file optimizer.h.
typedef struct qo_xasl_index_info QO_XASL_INDEX_INFO |
Definition at line 134 of file optimizer.h.
enum QO_PARAM |
Enumerator | |
---|---|
QO_PARAM_LEVEL | |
QO_PARAM_COST |
Definition at line 136 of file optimizer.h.
Definition at line 1357 of file query_graph.c.
References pt_expr_info::arg1, pt_expr_info::arg2, pt_expr_info::arg3, pt_function_info::arg_list, pt_statement_info::expr, pt_statement_info::function, i, parser_node::info, pt_statement_info::name, parser_node::next, parser_node::node_type, NULL, pt_expr_info::op, qo_env::parser, PT_FUNCTION_HOLDER, pt_function_index_skip_expr(), pt_is_function_index_expr(), PT_NAME, QO_ASSERT, QO_ENV_NODE, QO_NODE_ENTITY_SPEC, and pt_name_info::spec_id.
Referenced by qo_index_cardinality(), qo_validate_index_attr_notnull(), and set_seg_node().
QO_SEGMENT* lookup_seg | ( | QO_NODE * | head, |
PT_NODE * | name, | ||
QO_ENV * | env | ||
) |
Definition at line 1558 of file query_graph.c.
References qo_node::class_name, i, intl_identifier_casecmp(), NULL, qo_env::parser, parser_print_function_index_expr(), pt_is_function_index_expr(), pt_name_equal(), QO_ENV_PARSER, QO_ENV_SEG, QO_SEG_FUNC_INDEX, QO_SEG_HEAD, QO_SEG_NAME, and QO_SEG_PT_NODE.
Referenced by qo_index_cardinality(), qo_join_segment(), qo_validate_index_attr_notnull(), and set_seg_node().
PT_NODE* mq_optimize | ( | PARSER_CONTEXT * | parser, |
PT_NODE * | statement | ||
) |
Definition at line 7850 of file query_rewrite.c.
References NULL, parser_walk_tree(), qo_optimize_queries(), and qo_optimize_queries_post().
Referenced by mq_translate_helper().
Definition at line 5796 of file query_graph.c.
References qo_env::catch_, ER_FAILED_ASSERTION, er_set(), and ER_WARNING_SEVERITY.
Definition at line 2918 of file plan_generation.c.
References qo_info::env, xasl_node::if_pred, qo_plan::info, make_if_pred_from_plan(), make_pred_from_plan(), NULL, parser, parser_free_tree(), qo_plan::plan_type, qo_plan::plan_un, pt_to_pred_expr(), pt_to_spec_list(), QO_ENV_PARSER, qo_free_xasl_index_info(), qo_get_xasl_index_info(), QO_PLANTYPE_SCAN, QO_PLANTYPE_SORT, qo_plan::scan, qo_plan::sort, and xasl_node::spec_list.
Referenced by pt_plan_single_table_hq_iterations().
Definition at line 3478 of file plan_generation.c.
References assert, qo_info::env, error(), i, qo_plan::info, parser_node::info, qo_env::multi_range_opt_candidate, parser_node::next, NO_ERROR, NULL, pt_query_info::order_by, parser, qo_env::parser, parser_append_node(), parser_free_tree(), qo_plan::plan_un, pt_sort_spec_info::pos_descr, qfile_tuple_value_position::pos_no, pt_check_ordby_num_for_multi_range_opt(), PT_DISTINCT, pt_get_select_list(), pt_has_aggregate(), PT_HINT_NO_MULTI_RANGE_OPT, PT_IS_NAME_NODE, PT_IS_SELECT, pt_point(), qo_check_plan_index_for_multi_range_opt(), qo_check_subqueries_for_multi_range_opt(), qo_check_terms_for_multiple_range_opt(), QO_ENV_PT_TREE, qo_is_iscan(), QO_NODE_IS_CLASS_HIERARCHY, pt_statement_info::query, qo_plan::scan, pt_statement_info::sort_spec, and qo_plan::use_iscan_descending.
Referenced by qo_index_scan_new().
Definition at line 4215 of file plan_generation.c.
References assert, qo_info::env, error(), qo_plan::info, qo_plan::join, JOIN_INNER, NO_ERROR, NULL, qo_plan::plan_type, qo_plan::plan_un, PT_HINT_NO_MULTI_RANGE_OPT, PT_IS_SELECT, qo_env::pt_tree, qo_check_subplans_for_multi_range_opt(), QO_ENV_PT_TREE, qo_find_subplan_using_multi_range_opt(), QO_JOINMETHOD_MERGE_JOIN, and QO_PLANTYPE_JOIN.
Referenced by qo_join_new().
PT_NODE* qo_check_nullable_expr | ( | PARSER_CONTEXT * | parser, |
PT_NODE * | node, | ||
void * | arg, | ||
int * | continue_walk | ||
) |
Definition at line 171 of file query_rewrite.c.
References pt_statement_info::expr, parser_node::info, parser_node::node_type, pt_expr_info::op, PT_CASE, PT_COALESCE, PT_CONCAT_WS, PT_DECODE, PT_EXPR, PT_IF, PT_IFNULL, PT_IS_NULL, PT_ISNULL, PT_NVL, and PT_NVL2.
Referenced by mq_copypush_sargable_terms_helper().
Definition at line 2734 of file query_graph.c.
References ARG_FILE_LINE, ER_FAILED_ASSERTION, er_set(), ER_WARNING_SEVERITY, parser_node::next, NULL, qo_env::parser, parser_walk_tree(), pt_continue_walk(), QO_ENV_TMP_BITSET, and set_seg_expr().
Referenced by add_local_subquery(), gen_outer(), get_local_subqueries_pre(), qo_analyze_term(), qo_discover_sort_limit_nodes(), qo_optimize_helper(), qo_search_isnull_key_expr(), and qo_validate_index_attr_notnull().
Definition at line 9044 of file query_planner.c.
References pt_expr_info::arg1, pt_expr_info::arg2, DEFAULT_EXISTS_SELECTIVITY, DEFAULT_NULL_SELECTIVITY, DEFAULT_SELECTIVITY, pt_statement_info::expr, parser_node::info, parser_node::node_type, NULL, pt_expr_info::op, parser_node::or_next, prm_get_float_value(), PRM_ID_LIKE_TERM_SELECTIVITY, PT_AND, PT_BETWEEN, PT_EQ, PT_EQ_ALL, PT_EQ_SOME, PT_EXISTS, PT_EXPR, PT_GE, PT_GE_ALL, PT_GE_SOME, PT_GT, PT_GT_ALL, PT_GT_SOME, PT_IS, PT_IS_IN, PT_IS_NOT, PT_IS_NOT_IN, PT_IS_NOT_NULL, PT_IS_NULL, PT_LE, PT_LE_ALL, PT_LE_SOME, PT_LIKE, PT_LIKE_ESCAPE, PT_LT, PT_LT_ALL, PT_LT_SOME, PT_NE, PT_NE_ALL, PT_NE_SOME, PT_NOT, PT_NOT_BETWEEN, PT_NOT_LIKE, PT_NULLSAFE_EQ, PT_OR, PT_RANGE, PT_SETEQ, PT_SETNEQ, PT_SUBSET, PT_SUBSETEQ, PT_SUPERSET, PT_SUPERSETEQ, PT_XOR, qo_all_some_in_selectivity(), qo_and_selectivity(), QO_ASSERT, qo_between_selectivity(), qo_comp_selectivity(), qo_equal_selectivity(), qo_not_selectivity(), qo_or_selectivity(), and qo_range_selectivity().
Referenced by qo_analyze_term().
Definition at line 4595 of file plan_generation.c.
References error(), qo_plan::join, JOIN_INNER, NO_ERROR, NULL, qo_plan::plan_type, qo_plan::plan_un, qo_is_interesting_order_scan(), qo_plan_multi_range_opt(), and QO_PLANTYPE_JOIN.
Referenced by pt_ordbynum_to_key_limit_multiple_ranges(), qo_check_join_for_multi_range_opt(), and qo_multi_range_opt_plans_cmp().
QO_LIMIT_INFO* qo_get_key_limit_from_instnum | ( | PARSER_CONTEXT * | parser, |
QO_PLAN * | plan, | ||
xasl_node * | xasl | ||
) |
Definition at line 3279 of file plan_generation.c.
References db_private_alloc, db_private_free, DB_TYPE_BIGINT, regu_variable_node::domain, xasl_node::instnum_pred, qo_plan::join, JOIN_INNER, qo_limit_info::lower, tp_domain::next, regu_ptr_list_node::next, NULL, qo_plan::plan_type, qo_plan::plan_un, pt_make_regu_arith(), qo_get_limit_from_instnum_pred(), qo_is_interesting_order_scan(), QO_PLANTYPE_JOIN, QO_PLANTYPE_SCAN, regu_ptr_list_free(), T_GREATEST, T_LEAST, tp_domain_resolve_default(), qo_limit_info::upper, and regu_ptr_list_node::var_p.
Referenced by pt_instnum_to_key_limit().
QO_LIMIT_INFO* qo_get_key_limit_from_ordbynum | ( | PARSER_CONTEXT * | parser, |
QO_PLAN * | plan, | ||
xasl_node * | xasl, | ||
bool | ignore_lower | ||
) |
Definition at line 3387 of file plan_generation.c.
References db_private_alloc, db_private_free, DB_TYPE_BIGINT, regu_variable_node::domain, qo_limit_info::lower, tp_domain::next, NULL, xasl_node::ordbynum_pred, pt_make_regu_arith(), qo_get_limit_from_instnum_pred(), regu_ptr_list_free(), T_LEAST, tp_domain_resolve_default(), and qo_limit_info::upper.
Referenced by add_sort_spec(), pt_ordbynum_to_key_limit_multiple_ranges(), and pt_to_buildlist_proc().
void qo_get_optimization_param | ( | void * | , |
QO_PARAM | , | ||
... | |||
) |
Definition at line 269 of file query_graph.c.
References prm_get_integer_value(), PRM_ID_OPTIMIZATION_LEVEL, QO_PARAM_COST, QO_PARAM_LEVEL, and qo_plan_get_cost_fn().
Referenced by csql_get_sys_param(), csql_set_plan_dump(), do_find_unique_constraint_violations(), do_get_optimization_param(), do_insert_template(), pt_make_connect_by_proc(), pt_plan_query(), pt_plan_schema(), pt_plan_single_table_hq_iterations(), pt_print_select(), qo_can_generate_single_table_connect_by(), qo_need_skip_execution(), qo_optimize_helper(), qo_optimize_queries(), qo_optimize_query(), qo_plan_dump(), and qo_to_xasl().
Definition at line 2472 of file plan_generation.c.
References assert, qo_info::env, qo_plan::info, NULL, qo_plan::plan_un, qo_is_interesting_order_scan(), qo_is_prefix_index(), and qo_plan::scan.
Referenced by gen_outer(), pt_to_index_info(), qo_index_covering_plans_cmp(), qo_index_scan_new(), qo_plan_cmp(), qo_plan_cmp_prefer_covering_index(), qo_plan_scan_print_json(), qo_plan_scan_print_text(), qo_scan_fprint(), and qo_scan_info().
Definition at line 2500 of file plan_generation.c.
References assert, qo_info::env, qo_plan::info, qo_plan::multi_range_opt_use, NULL, PLAN_MULTI_RANGE_OPT_USE, qo_plan::plan_un, QO_ENTRY_MULTI_COL, qo_is_filter_index(), qo_is_interesting_order_scan(), and qo_plan::scan.
Referenced by pt_to_index_info(), qo_get_xasl_index_info(), qo_group_by_skip_plans_cmp(), qo_index_covering_plans_cmp(), qo_iscan_cost(), qo_order_by_skip_plans_cmp(), qo_plan_cmp(), qo_plan_cmp_prefer_covering_index(), qo_plan_compute_iscan_sort_list(), qo_scan_fprint(), and qo_scan_info().
Definition at line 2531 of file plan_generation.c.
References assert, qo_info::env, qo_plan::info, qo_plan::multi_range_opt_use, NULL, PLAN_MULTI_RANGE_OPT_USE, qo_plan::plan_un, QO_ENTRY_MULTI_COL, qo_is_iscan(), qo_is_prefix_index(), and qo_plan::scan.
Referenced by pt_to_index_info(), qo_get_xasl_index_info(), qo_group_by_skip_plans_cmp(), qo_index_covering_plans_cmp(), qo_index_scan_new(), qo_order_by_skip_plans_cmp(), qo_plan_cmp(), qo_plan_cmp_prefer_covering_index(), qo_plan_scan_print_json(), qo_plan_scan_print_text(), qo_scan_fprint(), and qo_scan_info().
Definition at line 2564 of file plan_generation.c.
References assert, qo_info::env, qo_plan::info, qo_plan::multi_range_opt_use, NULL, PLAN_MULTI_RANGE_OPT_USE, qo_plan::plan_un, QO_ENTRY_MULTI_COL, qo_is_filter_index(), qo_is_interesting_order_scan(), and qo_plan::scan.
Referenced by qo_multi_range_opt_plans_cmp(), qo_plan_cmp(), qo_search_planner(), and qo_unset_multi_range_optimization().
bool qo_need_skip_execution | ( | void | ) |
Definition at line 297 of file query_graph.c.
References qo_get_optimization_param(), and QO_PARAM_LEVEL.
Referenced by do_execute_insert(), do_execute_statement(), do_insert_template(), do_merge(), do_statement(), execute_query(), prepare_and_execute_query(), prepare_query(), and pt_plan_query().
QO_PLAN* qo_optimize_query | ( | PARSER_CONTEXT * | , |
PT_NODE * | |||
) |
Definition at line 358 of file query_graph.c.
References ARG_FILE_LINE, qo_env::catch_, walk_info::env, ER_ERROR_SEVERITY, ER_FAILED_ASSERTION, er_set(), parser_node::node_type, NULL, OPTIMIZATION_ENABLED, PT_SELECT, qo_env_free(), qo_env_init(), qo_get_optimization_param(), qo_optimize_helper(), and QO_PARAM_LEVEL.
Referenced by pt_plan_query(), and pt_plan_single_table_hq_iterations().
void qo_plan_discard | ( | QO_PLAN * | ) |
Definition at line 4456 of file query_planner.c.
References qo_env::dump_enable, qo_plan::info, qo_env_free(), qo_plan_del_ref, and qo_print_stats().
Referenced by pt_plan_query(), pt_plan_single_table_hq_iterations(), and qo_combine_partitions().
void qo_plan_dump | ( | QO_PLAN * | , |
FILE * | |||
) |
Definition at line 4621 of file query_planner.c.
References DETAILED_DUMP, NULL, qo_get_optimization_param(), QO_PARAM_LEVEL, qo_plan_fprint(), qo_plan_lite_print(), and SIMPLE_DUMP.
Referenced by pt_plan_query(), and pt_plan_single_table_hq_iterations().
int qo_plan_get_cost_fn | ( | const char * | ) |
Definition at line 4661 of file query_planner.c.
References i, intl_mbs_ncasecmp(), qo_node_index_entry::n, qo_worst_cost(), qo_zero_cost(), and strlen.
Referenced by csql_get_sys_param(), and qo_get_optimization_param().
Definition at line 2436 of file plan_generation.c.
References qo_plan::iscan_sort_list.
Referenced by pt_to_buildlist_proc().
Definition at line 2594 of file plan_generation.c.
References assert, qo_info::env, qo_plan::info, qo_plan::multi_range_opt_use, NULL, PLAN_MULTI_RANGE_OPT_USE, qo_plan::plan_un, QO_ENTRY_MULTI_COL, qo_is_filter_index(), qo_is_interesting_order_scan(), and qo_plan::scan.
Referenced by gen_outer(), pt_set_limit_optimization_flags(), pt_to_buildlist_proc(), pt_to_buildvalue_proc(), pt_to_index_info(), qo_check_subplans_for_multi_range_opt(), qo_find_subplan_using_multi_range_opt(), qo_multi_range_opt_plans_cmp(), qo_scan_fprint(), qo_scan_info(), qo_search_partition_join(), qo_search_planner(), and qo_top_plan_new().
Definition at line 4701 of file query_planner.c.
References qo_plan_vtbl::cost_fn, qo_plan_vtbl::default_cost, i, intl_mbs_ncasecmp(), qo_node_index_entry::n, NULL, qo_plan_vtbl::plan_string, qo_worst_cost(), qo_zero_cost(), and strlen.
Referenced by csql_set_sys_param(), qo_set_cost(), and qo_set_optimization_param().
Definition at line 2460 of file plan_generation.c.
References qo_plan::plan_type, qo_plan::plan_un, QO_PLANTYPE_SCAN, and qo_plan::scan.
Referenced by pt_to_buildlist_proc().
Definition at line 2447 of file plan_generation.c.
References qo_plan::plan_type, qo_plan::plan_un, QO_PLANTYPE_SORT, qo_plan::sort, SORT_DISTINCT, and SORT_ORDERBY.
Referenced by pt_to_buildlist_proc().
Definition at line 4765 of file query_planner.c.
References ARG_FILE_LINE, db_get_string(), db_make_error(), db_make_string(), DB_TYPE_CHAR, DB_TYPE_NCHAR, DB_TYPE_STRING, DB_VALUE_TYPE, ER_ERROR_SEVERITY, ER_GENERIC_ERROR, er_set(), NULL, and qo_plan_set_cost_fn().
void qo_set_optimization_param | ( | void * | , |
QO_PARAM | , | ||
... | |||
) |
Definition at line 316 of file query_graph.c.
References prm_get_integer_value(), PRM_ID_OPTIMIZATION_LEVEL, prm_set_integer_value(), QO_PARAM_COST, QO_PARAM_LEVEL, and qo_plan_set_cost_fn().
Referenced by csql_set_plan_dump(), csql_set_sys_param(), and do_set_optimization_param().
Definition at line 2368 of file plan_generation.c.
References ARG_FILE_LINE, EMPTY_SET, ER_FAILED_ASSERTION, er_msg(), er_set(), ER_WARNING_SEVERITY, xasl_node::fptr_list, gen_outer(), qo_plan::info, parser_node::info, pt_select_info::list, MATCH_ALL, NULL, qo_env::parser, PLAN_DUMP_ENABLED, preserve_info(), pt_set_dptr(), qo_env::pt_tree, pt_query_info::q, qo_get_optimization_param(), QO_PARAM_LEVEL, pt_statement_info::query, xasl_node::scan_ptr, and pt_query_info::select.
Referenced by pt_gen_optimized_plan().
void qo_top_plan_print_json | ( | PARSER_CONTEXT * | parser, |
xasl_node * | xasl, | ||
PT_NODE * | select, | ||
QO_PLAN * | plan | ||
) |
Definition at line 11446 of file query_planner.c.
References assert, parser_context::custom_print, pt_plan_trace_info::format, pt_select_info::group_by, indx_info::groupby_skip, access_spec_node::indexptr, parser_node::info, pt_plan_trace_info::json_plan, MAX_NUM_PLAN_TRACE, NULL, parser_context::num_plan_trace, pt_query_info::order_by, indx_info::orderby_skip, parser_print_tree(), parser_context::plan_trace, PT_CONVERT_RANGE, pt_query_info::q, qo_plan_print_json(), pt_statement_info::query, QUERY_TRACE_JSON, pt_query_info::select, xasl_node::spec_list, and pt_plan_trace_info::trace.
Referenced by pt_plan_query().
void qo_top_plan_print_text | ( | PARSER_CONTEXT * | parser, |
xasl_node * | xasl, | ||
PT_NODE * | select, | ||
QO_PLAN * | plan | ||
) |
Definition at line 11748 of file query_planner.c.
References assert, parser_context::custom_print, pt_plan_trace_info::format, pt_select_info::group_by, indx_info::groupby_skip, access_spec_node::indexptr, parser_node::info, MAX_NUM_PLAN_TRACE, NULL, parser_context::num_plan_trace, pt_query_info::order_by, indx_info::orderby_skip, parser_print_tree(), parser_context::plan_trace, port_close_memstream(), port_open_memstream(), PT_CONVERT_RANGE, pt_query_info::q, qo_plan_print_text(), pt_statement_info::query, QUERY_TRACE_TEXT, pt_query_info::select, xasl_node::spec_list, pt_plan_trace_info::text_plan, and pt_plan_trace_info::trace.
Referenced by pt_plan_query().
int qo_xasl_get_num_terms | ( | QO_XASL_INDEX_INFO * | info | ) |
Definition at line 2893 of file plan_generation.c.
References qo_xasl_index_info::nterms.
Referenced by pt_to_index_attrs(), and pt_to_index_info().
PT_NODE** qo_xasl_get_terms | ( | QO_XASL_INDEX_INFO * | ) |
Definition at line 2905 of file plan_generation.c.
References qo_xasl_index_info::term_exprs.
Referenced by pt_to_index_attrs(), and pt_to_index_info().