CUBRID Engine
latest
|
#include <assert.h>
#include "optimizer.h"
#include "config.h"
#include "object_primitive.h"
#include "query_bitset.h"
#include "query_graph.h"
#include "query_planner.h"
#include "parser.h"
#include "parser_support.h"
#include "system_parameter.h"
#include "xasl.h"
#include "xasl_generation.h"
#include "xasl_predicate.hpp"
Go to the source code of this file.
Typedefs | |
typedef int(* | ELIGIBILITY_FN) (QO_TERM *) |
typedef int(* ELIGIBILITY_FN) (QO_TERM *) |
Definition at line 41 of file plan_generation.c.
Definition at line 701 of file plan_generation.c.
References add_if_predicate(), assert, pt_select_info::connect_by, pt_spec_info::id, parser_node::info, xasl_node::iscycle_val, xasl_node::isleaf_val, xasl_node::level_val, make_if_pred_from_plan(), make_instnum_pred_from_plan(), make_pred_from_plan(), parser_node::node_type, NULL, parser, parser_free_tree(), qo_plan::plan_type, qo_plan::plan_un, PT_IS_VALUE_QUERY, PT_SELECT, pt_set_connect_by_operator_node_etc(), pt_set_iscycle_node_etc(), pt_set_isleaf_node_etc(), pt_set_level_node_etc(), pt_set_qprior_node_etc(), PT_SET_VALUE_QUERY, pt_to_instnum_pred(), pt_to_spec_list(), pt_to_val_list(), qo_env::pt_tree, pt_query_info::q, QO_ENV_PARSER, qo_free_xasl_index_info(), qo_get_xasl_index_info(), QO_NODE_ENTITY_SPEC, QO_PLANTYPE_SCAN, pt_statement_info::query, qo_plan::scan, pt_query_info::select, pt_statement_info::spec, xasl_node::spec_list, success(), and xasl_node::val_list.
Referenced by gen_outer().
|
static |
Definition at line 1014 of file plan_generation.c.
References xasl_node::after_join_pred, parser, pt_to_pred_expr(), and QO_ENV_PARSER.
Referenced by init_class_scan_proc(), and init_list_scan_proc().
Definition at line 809 of file plan_generation.c.
References xasl_node::fptr_list, and NULL.
Referenced by gen_inner(), and gen_outer().
Definition at line 993 of file plan_generation.c.
References xasl_node::if_pred, parser, pt_to_pred_expr(), and QO_ENV_PARSER.
Referenced by add_access_spec(), init_class_scan_proc(), init_list_scan_proc(), and make_fetch_proc().
Definition at line 784 of file plan_generation.c.
References NULL, and xasl_node::scan_ptr.
Referenced by gen_inner(), and gen_outer().
|
static |
Definition at line 911 of file plan_generation.c.
References db_private_free, parser_node::info, qo_plan::join, make_instnum_pred_from_plan(), parser_node::next, NULL, xasl_node::ordbynum_flag, xasl_node::ordbynum_pred, xasl_node::ordbynum_val, pt_query_info::order_by, pt_query_info::orderby_for, xasl_node::orderby_limit, xasl_node::orderby_list, parser, parser_free_tree(), qo_plan::plan_type, qo_plan::plan_un, PT_PRED_ARG_ORDBYNUM_CONTINUE, pt_to_instnum_pred(), pt_to_orderby(), pt_to_pred_expr_with_arg(), QO_ENV_PARSER, QO_ENV_PT_TREE, qo_get_key_limit_from_ordbynum(), qo_get_orderby_num_upper_bound_node(), QO_JOINMETHOD_MERGE_JOIN, QO_PLANTYPE_JOIN, pt_statement_info::query, qo_plan::sort, SORT_LIMIT, qo_limit_info::upper, XASL_CLEAR_FLAG, XASL_ORDBYNUM_FLAG_SCAN_CONTINUE, and XASL_SKIP_ORDERBY_LIST.
Referenced by gen_outer(), and make_sort_limit_proc().
Definition at line 872 of file plan_generation.c.
References xasl_node::aptr_list, bitset_is_empty(), bitset_iterate(), bitset_next_member(), xasl_node::dptr_list, i, if(), parser_node::info, qo_subquery::node, qo_subquery::nodes, pt_append_xasl(), pt_remove_xasl(), pt_statement_info::query, qo_env::subqueries, and pt_query_info::xasl.
Referenced by gen_inner(), and gen_outer().
Definition at line 842 of file plan_generation.c.
References xasl_node::aptr_list, NULL, pt_append_xasl(), and pt_remove_xasl().
Referenced by gen_inner(), and gen_outer().
Definition at line 547 of file plan_generation.c.
References bitset_iterate(), bitset_next_member(), i, QO_ENV_TERM, and QO_IS_PATH_TERM.
Referenced by make_if_pred_from_plan(), and make_pred_from_plan().
Definition at line 1467 of file plan_generation.c.
References xasl_node::aptr_list, ARG_FILE_LINE, ER_FAILED_ASSERTION, er_set(), ER_WARNING_SEVERITY, i, mergelist_proc_node::inner_xasl, qfile_list_merge_info::ls_column_cnt, qfile_list_merge_info::ls_inner_column, mergelist_proc_node::ls_merge, qfile_list_merge_info::ls_outer_column, xasl_node::mergelist, MERGELIST_PROC, xasl_node::next, NULL, mergelist_proc_node::outer_xasl, xasl_node::outptr_list, xasl_node::proc, xasl_node::spec_list, xasl_node::type, and xasl_node::val_list.
Referenced by gen_outer().
|
static |
Definition at line 2213 of file plan_generation.c.
References add_fetch_proc(), add_scan_proc(), add_subqueries(), add_uncorrelated(), bitset_assign(), bitset_delset(), bitset_init(), bitset_union(), EMPTY_SET, qo_plan::follow, gen_outer(), init_class_scan_proc(), init_list_scan_proc(), make_buildlist_proc(), make_fetch_proc(), make_namelist_from_projected_segs(), make_scan_proc(), NULL, qo_env::parser, parser_free_tree(), qo_plan::plan_type, qo_plan::plan_un, QO_ASSERT, QO_PLANTYPE_FOLLOW, QO_PLANTYPE_JOIN, QO_PLANTYPE_SCAN, QO_PLANTYPE_SORT, QO_PLANTYPE_WORST, qo_plan::sarged_terms, qo_plan::sort, SORT_TEMP, and qo_plan::subqueries.
Referenced by gen_outer().
|
static |
Definition at line 1566 of file plan_generation.c.
References add_access_spec(), add_fetch_proc(), add_scan_proc(), add_sort_spec(), add_subqueries(), add_uncorrelated(), pt_expr_info::arg1, ARG_FILE_LINE, assert, bitset_add(), bitset_assign(), BITSET_CLEAR, bitset_delset(), bitset_difference(), bitset_init(), bitset_intersect(), bitset_intersects(), bitset_is_empty(), bitset_iterate(), BITSET_MEMBER, bitset_next_member(), bitset_union(), check_merge_xasl(), EMPTY_SET, ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), pt_statement_info::expr, qo_plan::follow, free_and_init, gen_inner(), i, qo_plan::info, parser_node::info, init_list_scan_proc(), is_normal_access_term(), IS_OUTER_JOIN_TYPE, is_totally_after_join_term(), qo_plan::join, JOIN_CSELECT, mergelist_proc_node::ls_merge, qfile_list_merge_info::ls_outer_inner_list, qfile_list_merge_info::ls_pos_cnt, qfile_list_merge_info::ls_pos_list, make_buildlist_proc(), make_fetch_proc(), make_mergelist_proc(), make_namelist_from_projected_segs(), make_outer_instnum(), make_sort_limit_proc(), mark_access_as_outer_join(), xasl_node::mergelist, parser_node::next, NO_JOIN, qo_index_entry::nsegs, NULL, pt_expr_info::op, xasl_node::ordbynum_val, p, parser, parser_append_node(), parser_free_tree(), qo_plan::plan_type, qo_plan::plan_un, xasl_node::proc, pt_find_attribute(), pt_gen_simple_merge_plan(), pt_is_expr_node, pt_is_function, pt_left_part(), pt_length_of_list(), pt_point(), PT_RANGE, pt_right_part(), QFILE_INNER_LIST, QFILE_OUTER_LIST, QO_ENV_PARSER, QO_ENV_PT_TREE, QO_ENV_SEG, QO_ENV_TERM, qo_expr_segs(), QO_IS_FAKE_TERM, qo_is_index_covering_scan(), qo_is_iscan(), qo_is_seq_scan(), QO_JOINMETHOD_IDX_JOIN, QO_JOINMETHOD_MERGE_JOIN, QO_JOINMETHOD_NL_JOIN, QO_NODE_SEGS, qo_plan_multi_range_opt(), QO_PLANTYPE_FOLLOW, QO_PLANTYPE_JOIN, QO_PLANTYPE_SCAN, QO_PLANTYPE_SORT, QO_PLANTYPE_WORST, QO_SEG_PT_NODE, QO_TERM_IDX, QO_TERM_PT_EXPR, QO_TERM_SEGS, QO_TERM_SUBQUERIES, qo_plan::sarged_terms, qo_plan::scan, qo_index_entry::seg_idxs, qo_term::segments, qo_plan::sort, SORT_LIMIT, SORT_TEMP, qo_plan::subqueries, and qo_plan::top_rooted.
Referenced by gen_inner(), make_sort_limit_proc(), and qo_to_xasl().
Definition at line 597 of file plan_generation.c.
References add_after_join_predicate(), add_if_predicate(), is_after_join_term(), make_if_pred_from_plan(), make_pred_from_bitset(), make_pred_from_plan(), parser, parser_free_tree(), qo_plan::plan_un, ptqo_to_scan_proc(), QO_ENV_PARSER, qo_free_xasl_index_info(), qo_get_xasl_index_info(), QO_NODE_ENTITY_SPEC, qo_plan::sarged_terms, and qo_plan::scan.
Referenced by gen_inner().
|
static |
Definition at line 656 of file plan_generation.c.
References add_after_join_predicate(), add_if_predicate(), pt_select_info::connect_by, parser_node::info, is_after_join_term(), is_normal_access_term(), is_normal_if_term(), is_totally_after_join_term(), xasl_node::iscycle_val, xasl_node::isleaf_val, xasl_node::level_val, make_pred_from_bitset(), parser_node::node_type, parser_free_tree(), PT_SELECT, pt_set_connect_by_operator_node_etc(), pt_set_iscycle_node_etc(), pt_set_isleaf_node_etc(), pt_set_level_node_etc(), pt_set_qprior_node_etc(), pt_to_instnum_pred(), qo_env::pt_tree, ptqo_to_list_scan_proc(), pt_query_info::q, QO_ENV_PARSER, pt_statement_info::query, SCAN_PROC, and pt_query_info::select.
Referenced by gen_inner(), and gen_outer().
|
static |
Definition at line 1099 of file plan_generation.c.
References bitset_is_empty(), QO_TC_AFTER_JOIN, QO_TERM_CLASS, and QO_TERM_SUBQUERIES.
Referenced by init_class_scan_proc(), and init_list_scan_proc().
|
static |
Definition at line 1156 of file plan_generation.c.
Referenced by make_mergelist_proc(), and make_pred_from_plan().
|
static |
Definition at line 1139 of file plan_generation.c.
References QO_TC_AFTER_JOIN, QO_TC_DURING_JOIN, QO_TC_TOTALLY_AFTER_JOIN, and QO_TERM_CLASS.
Referenced by make_if_pred_from_plan().
|
static |
Definition at line 1055 of file plan_generation.c.
References bitset_is_empty(), QO_TC_AFTER_JOIN, QO_TC_OTHER, QO_TC_TOTALLY_AFTER_JOIN, QO_TERM_CLASS, and QO_TERM_SUBQUERIES.
Referenced by gen_outer(), init_list_scan_proc(), and make_pred_from_plan().
|
static |
Definition at line 1079 of file plan_generation.c.
References bitset_is_empty(), QO_TC_OTHER, QO_TERM_CLASS, and QO_TERM_SUBQUERIES.
Referenced by init_list_scan_proc(), and make_if_pred_from_plan().
|
static |
Definition at line 1119 of file plan_generation.c.
References bitset_is_empty(), QO_TC_TOTALLY_AFTER_JOIN, QO_TERM_CLASS, and QO_TERM_SUBQUERIES.
Referenced by gen_outer(), init_list_scan_proc(), make_instnum_pred_from_plan(), make_outer_instnum(), and path_if_term().
Definition at line 535 of file plan_generation.c.
References pt_skeleton_buildlist_proc(), and QO_ENV_PARSER.
Referenced by gen_inner(), gen_outer(), and make_sort_limit_proc().
Definition at line 130 of file plan_generation.c.
References add_if_predicate(), qo_plan::follow, make_if_pred_from_plan(), make_pred_from_plan(), NULL, parser_free_tree(), qo_plan::plan_un, pt_to_fetch_proc(), QO_ENV_PARSER, QO_NODE_ENTITY_SPEC, and QO_TERM_TAIL.
Referenced by gen_inner(), and gen_outer().
Definition at line 1381 of file plan_generation.c.
References bitset_has_path(), is_follow_if_term(), is_normal_if_term(), make_pred_from_bitset(), path_if_term(), qo_plan::plan_type, QO_PLANTYPE_FOLLOW, and qo_plan::sarged_terms.
Referenced by add_access_spec(), init_class_scan_proc(), make_fetch_proc(), and qo_add_hq_iterations_access_spec().
Definition at line 1411 of file plan_generation.c.
References is_totally_after_join_term(), make_pred_from_bitset(), and qo_plan::sarged_terms.
Referenced by add_access_spec(), and add_sort_spec().
|
static |
Definition at line 173 of file plan_generation.c.
References xasl_node::after_join_pred, ARG_FILE_LINE, assert, bitset_assign(), bitset_cardinality(), bitset_delset(), bitset_first_member(), bitset_init(), bitset_intersect(), bitset_iterate(), BITSET_MEMBER, bitset_next_member(), qfile_tuple_value_position::dom, ER_ERROR_SEVERITY, ER_FAILED_ASSERTION, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), ER_WARNING_SEVERITY, free_and_init, i, mergelist_proc_node::inner_spec_list, mergelist_proc_node::inner_val_list, is_always_true(), qo_plan::join, JOIN_INNER, qfile_list_merge_info::join_type, qfile_list_merge_info::ls_column_cnt, qfile_list_merge_info::ls_inner_column, qfile_list_merge_info::ls_inner_unique, mergelist_proc_node::ls_merge, qfile_list_merge_info::ls_outer_column, qfile_list_merge_info::ls_outer_inner_list, qfile_list_merge_info::ls_outer_unique, qfile_list_merge_info::ls_pos_cnt, qfile_list_merge_info::ls_pos_list, make_pred_from_bitset(), xasl_node::mergelist, sort_list::next, parser_node::next, NULL, xasl_node::orderby_list, mergelist_proc_node::outer_spec_list, mergelist_proc_node::outer_val_list, parser, parser_free_tree(), qo_plan::plan_un, sort_list::pos_descr, qfile_tuple_value_position::pos_no, xasl_node::proc, pt_alloc_packing_buf(), pt_find_attribute(), pt_length_of_list(), pt_to_pred_expr(), pt_xasl_node_to_domain(), ptqo_single_orderby(), ptqo_to_list_scan_proc(), ptqo_to_merge_list_proc(), QFILE_INNER_LIST, QFILE_OUTER_LIST, QO_ENV_PARSER, QO_ENV_SEG, QO_ENV_TERM, QO_IS_PATH_TERM, QO_SEG_PT_NODE, QO_TERM_SEGS, QPROC_SINGLE_OUTER, S_ASC, sort_list::s_order, SCAN_PROC, qfile_list_merge_info::single_fetch, xasl_node::spec_list, and xasl_node::val_list.
Referenced by gen_outer().
Definition at line 1432 of file plan_generation.c.
References bitset_iterate(), bitset_next_member(), i, qo_plan::info, parser_node::next, NULL, parser, pt_point(), QO_ENV_PARSER, QO_ENV_SEG, and QO_SEG_PT_NODE.
Referenced by gen_inner(), and gen_outer().
Definition at line 1536 of file plan_generation.c.
References bitset_add(), bitset_iterate(), bitset_next_member(), is_totally_after_join_term(), QO_ENV_TERM, and qo_plan::sarged_terms.
Referenced by gen_outer().
|
static |
Definition at line 1173 of file plan_generation.c.
References bitset_iterate(), bitset_next_member(), cmp, i, parser_node::info, parser_node::next, NULL, parser, parser_free_tree(), pt_statement_info::pointer, pt_point(), QO_ENV_PARSER, QO_ENV_TERM, QO_IS_FAKE_TERM, QO_TERM_PT_EXPR, QO_TERM_RANK, QO_TERM_SELECTIVITY, pt_pointer_info::rank, and pt_pointer_info::sel.
Referenced by init_class_scan_proc(), init_list_scan_proc(), make_if_pred_from_plan(), make_instnum_pred_from_plan(), make_mergelist_proc(), and make_pred_from_plan().
|
static |
Definition at line 1287 of file plan_generation.c.
References bitset_add(), bitset_difference(), bitset_has_path(), qo_index_entry::constraints, qo_index_entry::cover_segments, sm_class_constraint::func_index_info, qo_node_index_entry::head, is_always_true(), is_normal_access_term(), make_pred_from_bitset(), qo_xasl_index_info::need_copy_multi_range_term, qo_xasl_index_info::need_copy_to_sarg_term, qo_xasl_index_info::ni_entry, NULL, path_access_term(), qo_plan::plan_type, qo_plan::plan_un, QO_PLANTYPE_FOLLOW, qo_plan::sarged_terms, and qo_plan::scan.
Referenced by add_access_spec(), init_class_scan_proc(), make_fetch_proc(), and qo_add_hq_iterations_access_spec().
Definition at line 117 of file plan_generation.c.
References NULL, ptqo_to_scan_proc(), and QO_ENV_PARSER.
Referenced by gen_inner().
|
static |
Definition at line 4649 of file plan_generation.c.
References add_sort_spec(), assert_release, cleanup(), EMPTY_SET, gen_outer(), parser_node::info, make_buildlist_proc(), NULL, xasl_node::ordbynum_val, pt_query_info::order_by, pt_query_info::orderby_for, parser, parser_copy_tree_list(), parser_free_tree(), parser_walk_tree(), qo_plan::plan_un, pt_get_numbering_node_etc(), pt_set_orderby_for_sort_limit_plan(), QO_ENV_PARSER, QO_ENV_PT_TREE, pt_statement_info::query, and qo_plan::sort.
Referenced by gen_outer().
|
static |
Definition at line 574 of file plan_generation.c.
References access_spec_node::next, QPROC_NO_SINGLE_OUTER, access_spec_node::single_fetch, and xasl_node::spec_list.
Referenced by gen_outer().
|
static |
Definition at line 1033 of file plan_generation.c.
References QO_IS_PATH_TERM.
Referenced by make_pred_from_plan().
|
static |
Definition at line 1044 of file plan_generation.c.
References is_totally_after_join_term(), and QO_IS_PATH_TERM.
Referenced by make_if_pred_from_plan().
Definition at line 2314 of file plan_generation.c.
References qo_summary::cardinality, xasl_node::cardinality, qo_summary::fixed_cpu_cost, qo_plan::fixed_cpu_cost, qo_summary::fixed_io_cost, qo_plan::fixed_io_cost, qo_plan::info, parser_node::info, NULL, parser, parser_alloc(), xasl_node::projected_size, pt_query_info::q, QO_ENV_PARSER, QO_ENV_PT_TREE, pt_select_info::qo_summary, pt_statement_info::query, pt_query_info::select, qo_summary::variable_cpu_cost, qo_plan::variable_cpu_cost, qo_summary::variable_io_cost, qo_plan::variable_io_cost, and qo_summary::xasl.
Referenced by qo_to_xasl().
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().
|
static |
Definition at line 4499 of file plan_generation.c.
References assert, bitset_iterate(), bitset_next_member(), qo_info::env, qo_plan::info, qo_env::neqclasses, NULL, qo_plan::plan_type, qo_plan::plan_un, qo_check_seg_belongs_to_range_term(), QO_ENV_EQCLASS, QO_ENV_SEG, QO_EQCLASS_SEGS, QO_PLANTYPE_JOIN, QO_PLANTYPE_SCAN, QO_SEG_HEAD, and qo_plan::scan.
Referenced by qo_check_subplans_for_multi_range_opt().
|
static |
Definition at line 3647 of file plan_generation.c.
References pt_sort_spec_info::asc_or_desc, assert, CAST_POINTER_TO_NODE, DB_TYPE_MIDXKEY, qo_info::env, qo_index_entry::first_sort_column, i, qo_plan::info, parser_node::info, qo_index_entry::key_type, tp_domain::next, parser_node::next, NO_ERROR, parser_node::node_type, qo_index_entry::nsegs, NULL, qo_env::parser, qo_plan::plan_un, PT_DESC, PT_NAME, pt_name_equal(), PT_SORT_SPEC, QO_ENV_SEG, qo_is_iscan(), QO_SEG_PT_NODE, qo_plan::scan, qo_index_entry::seg_idxs, tp_domain::setdomain, pt_statement_info::sort_spec, and TP_DOMAIN_TYPE.
Referenced by qo_check_iscan_for_multi_range_opt().
|
static |
Definition at line 4091 of file plan_generation.c.
References assert, bitset_iterate(), bitset_next_member(), pt_statement_info::expr, parser_node::info, pt_expr_info::op, qo_plan::plan_type, qo_plan::plan_un, PT_EQ_SOME, PT_IS_IN, PT_RANGE, QO_ENV_TERM, QO_PLANTYPE_SCAN, QO_TERM_PT_EXPR, QO_TERM_SEGS, qo_plan::sarged_terms, and qo_plan::scan.
Referenced by qo_check_parent_eq_class_for_multi_range_opt(), qo_check_subplan_join_cond_for_multi_range_opt(), and qo_check_subqueries_for_multi_range_opt().
|
static |
Definition at line 4381 of file plan_generation.c.
References assert, bitset_iterate(), bitset_next_member(), qo_info::env, qo_plan::info, qo_plan::join, qo_term::nodes, NULL, qo_plan::plan_type, qo_plan::plan_un, qo_check_seg_belongs_to_range_term(), QO_ENV_NODE, QO_ENV_SEG, QO_ENV_TERM, QO_PLANTYPE_JOIN, QO_SEG_HEAD, qo_plan::scan, and qo_term::segments.
Referenced by qo_check_subplans_for_multi_range_opt().
|
static |
Definition at line 4285 of file plan_generation.c.
References error(), qo_plan::join, qo_plan::multi_range_opt_use, NO_ERROR, NULL, PLAN_MULTI_RANGE_OPT_CANNOT_USE, qo_plan::plan_type, qo_plan::plan_un, qo_check_parent_eq_class_for_multi_range_opt(), qo_check_subplan_join_cond_for_multi_range_opt(), qo_plan_multi_range_opt(), QO_PLANTYPE_JOIN, and QO_PLANTYPE_SCAN.
Referenced by qo_check_join_for_multi_range_opt().
Definition at line 4017 of file plan_generation.c.
References assert, bitset_iterate(), bitset_next_member(), qo_info::env, i, qo_plan::info, qo_env::nsubqueries, NULL, qo_plan::plan_type, qo_plan::plan_un, qo_check_seg_belongs_to_range_term(), QO_ENV_SEG, QO_ENV_SUBQUERY, QO_ENV_TERM, QO_PLANTYPE_SCAN, QO_SEG_HEAD, qo_plan::scan, qo_term::segments, and qo_subquery::terms.
Referenced by qo_check_iscan_for_multi_range_opt().
|
static |
Definition at line 3799 of file plan_generation.c.
References assert, bitset_iterate(), bitset_next_member(), qo_term::can_use_index, qo_info::env, ER_FAILED, pt_statement_info::expr, free_and_init, i, qo_term::index_seg, qo_plan::info, parser_node::info, NO_ERROR, qo_index_entry::nsegs, qo_env::nterms, NULL, pt_expr_info::op, qo_plan::plan_un, PT_BETWEEN_EQ_NA, PT_EQ, PT_EQ_SOME, PT_IS_EXPR_NODE, PT_IS_IN, PT_RANGE, QO_ENV_SEG, QO_ENV_TERM, qo_is_interesting_order_scan(), QO_SEG_HEAD, QO_SEG_IDX, QO_TERM_IS_FLAGED, QO_TERM_NON_IDX_SARG_COLL, QO_TERM_PT_EXPR, qo_plan::scan, qo_index_entry::seg_idxs, and qo_term::segments.
Referenced by qo_check_iscan_for_multi_range_opt().
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().
|
static |
Definition at line 2868 of file plan_generation.c.
References free_and_init, qo_xasl_index_info::multi_col_pos, and qo_xasl_index_info::term_exprs.
Referenced by add_access_spec(), init_class_scan_proc(), qo_add_hq_iterations_access_spec(), and qo_get_xasl_index_info().
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().
|
static |
Definition at line 3099 of file plan_generation.c.
References DB_TYPE_BIGINT, cubxasl::eval_term::et, cubxasl::eval_term::et_comp, cubxasl::eval_term::et_type, cubxasl::comp_eval_term::lhs, cubxasl::pred_expr::m_eval_term, NULL, parser_free_node(), cubxasl::pred_expr::pe, pt_make_integer_value(), pt_make_regu_arith(), pt_to_regu_variable(), qo_validate_regu_var_for_limit(), R_EQ, R_GE, R_GT, R_LE, R_LT, regu_ptr_list_add_regu(), cubxasl::comp_eval_term::rel_op, cubxasl::comp_eval_term::rhs, T_COMP_EVAL_TERM, T_EVAL_TERM, T_SUB, tp_domain_resolve_default(), cubxasl::pred_expr::type, TYPE_CONSTANT, and UNBOX_AS_VALUE.
Referenced by qo_get_limit_from_instnum_pred().
|
static |
Definition at line 3248 of file plan_generation.c.
References B_AND, cubxasl::pred::bool_op, cubxasl::pred::lhs, cubxasl::pred_expr::m_pred, NULL, cubxasl::pred_expr::pe, qo_get_limit_from_eval_term(), cubxasl::pred::rhs, T_EVAL_TERM, T_PRED, and cubxasl::pred_expr::type.
Referenced by qo_get_key_limit_from_instnum(), and qo_get_key_limit_from_ordbynum().
|
static |
Definition at line 4885 of file plan_generation.c.
References bitset_assign(), bitset_iterate(), bitset_next_member(), qo_index_entry::index_segs, NULL, qo_plan::plan_un, QO_ENV_TERM, QO_TERM_IS_FLAGED, QO_TERM_MULTI_COLL_PRED, QO_TERM_SEGS, and qo_plan::scan.
Referenced by qo_get_xasl_index_info().
|
static |
Definition at line 4734 of file plan_generation.c.
References pt_expr_info::arg1, pt_expr_info::arg2, assert, pt_statement_info::expr, parser_node::info, parser_node::next, NULL, pt_expr_info::op, parser_node::or_next, parser_copy_tree(), parser_free_tree(), parser_new_node(), PT_BETWEEN, PT_BETWEEN_AND, PT_EXPR, PT_GE, PT_GT, PT_IS_EXPR_NODE, PT_LE, PT_LT, and PT_ORDERBY_NUM.
Referenced by add_sort_spec().
|
static |
Definition at line 2637 of file plan_generation.c.
References ARG_FILE_LINE, assert, bitset_cardinality(), bitset_delset(), bitset_init(), bitset_iterate(), BITSET_MEMBER, bitset_next_member(), bitset_subset(), qo_term::can_use_index, ER_ERROR_SEVERITY, ER_FAILED_ASSERTION, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), ER_WARNING_SEVERITY, error(), i, qo_term::index_seg, qo_index_entry::is_iss_candidate, qo_term::multi_col_cnt, qo_xasl_index_info::multi_col_pos, qo_term::multi_col_segs, qo_xasl_index_info::need_copy_multi_range_term, qo_xasl_index_info::need_copy_to_sarg_term, qo_xasl_index_info::ni_entry, qo_index_entry::nsegs, qo_xasl_index_info::nterms, NULL, qo_plan::plan_un, PT_SPEC_SPECIAL_INDEX_SCAN, QO_ENV_TERM, qo_free_xasl_index_info(), qo_get_multi_col_range_segs(), qo_is_filter_index(), qo_is_index_iss_scan(), qo_is_index_loose_scan(), qo_is_interesting_order_scan(), qo_is_iscan_from_groupby(), qo_is_iscan_from_orderby(), QO_NODE_ENTITY_SPEC, QO_SEG_IDX, QO_TERM_IS_FLAGED, QO_TERM_MULTI_COLL_CONST, QO_TERM_MULTI_COLL_PRED, QO_TERM_PT_EXPR, qo_plan::sarged_terms, qo_plan::scan, qo_index_entry::seg_idxs, and qo_xasl_index_info::term_exprs.
Referenced by add_access_spec(), init_class_scan_proc(), and qo_add_hq_iterations_access_spec().
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().
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 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 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().
|
static |
Definition at line 3059 of file plan_generation.c.
References arith_list_node::leftptr, NULL, arith_list_node::rightptr, arith_list_node::thirdptr, TYPE_DBVAL, TYPE_INARITH, TYPE_POS_VALUE, and arith_list_node::value.
Referenced by qo_get_limit_from_eval_term().
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 * | 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().
|
static |
Definition at line 3036 of file plan_generation.c.
References db_private_alloc, regu_ptr_list_node::next, NULL, regu_ptr_list_free(), and regu_ptr_list_node::var_p.
Referenced by qo_get_limit_from_eval_term().
|
static |
Definition at line 2991 of file plan_generation.c.
References db_private_alloc, regu_ptr_list_node::next, NULL, p, and regu_ptr_list_node::var_p.
|
static |
Definition at line 3015 of file plan_generation.c.
References db_private_free, regu_ptr_list_node::next, and NULL.
Referenced by qo_get_key_limit_from_instnum(), qo_get_key_limit_from_ordbynum(), and regu_ptr_list_add_regu().