CUBRID Engine
latest
|
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "query_bitset.h"
#include "memory_alloc.h"
Go to the source code of this file.
Macros | |
#define | NBYTES(n) ((n) * sizeof(BITSET_CARRIER)) |
#define | NELEMS(n) ((n) * _WORDSIZE) |
#define | bitset_malloc(env, size) malloc(size) |
#define | bitset_free(ptr) free_and_init(ptr) |
Functions | |
void | bitset_extend (BITSET *dst, int nwords) |
void | bitset_assign (BITSET *dst, const BITSET *src) |
void | bitset_add (BITSET *dst, int x) |
void | bitset_remove (BITSET *dst, int x) |
void | bitset_union (BITSET *dst, const BITSET *src) |
void | bitset_intersect (BITSET *dst, const BITSET *src) |
void | bitset_difference (BITSET *dst, const BITSET *src) |
int | bitset_subset (const BITSET *r, const BITSET *s) |
int | bitset_intersects (const BITSET *r, const BITSET *s) |
int | bitset_is_empty (const BITSET *s) |
int | bitset_is_equivalent (const BITSET *r, const BITSET *s) |
int | bitset_cardinality (const BITSET *s) |
int | bitset_iterate (const BITSET *s, BITSET_ITERATOR *si) |
int | bitset_next_member (BITSET_ITERATOR *si) |
int | bitset_first_member (const BITSET *s) |
void | bitset_print (const BITSET *s, FILE *fp) |
void | bitset_init (BITSET *s, QO_ENV *env) |
void | bitset_delset (BITSET *s) |
Variables | |
static const char | nbits [] |
static BITSET_CARRIER | empty_set_words [NWORDS] = { 0 } |
BITSET | EMPTY_SET = { NULL, empty_set_words, NWORDS, {{0}} } |
#define bitset_free | ( | ptr | ) | free_and_init(ptr) |
Definition at line 39 of file query_bitset.c.
Referenced by bitset_delset(), and bitset_extend().
#define bitset_malloc | ( | env, | |
size | |||
) | malloc(size) |
Definition at line 38 of file query_bitset.c.
#define NBYTES | ( | n | ) | ((n) * sizeof(BITSET_CARRIER)) |
Definition at line 35 of file query_bitset.c.
Referenced by bitset_assign(), and bitset_extend().
#define NELEMS | ( | n | ) | ((n) * _WORDSIZE) |
Definition at line 36 of file query_bitset.c.
void bitset_add | ( | BITSET * | dst, |
int | x | ||
) |
Definition at line 138 of file query_bitset.c.
References _BIT, _WORD, and bitset_extend().
Referenced by add_hint(), check_subquery_pre(), gen_outer(), make_outer_instnum(), make_pred_from_plan(), planner_permutate(), planner_visit_node(), qo_add_dep_term(), qo_add_dummy_join_term(), qo_add_term(), qo_alloc_planner(), qo_analyze_term(), qo_classify_outerjoin_terms(), qo_combine_partitions(), qo_discover_indexes(), qo_discover_partitions(), qo_discover_sort_limit_join_nodes(), qo_eqclass_add(), qo_examine_correlated_index(), qo_find_index_seg_terms(), qo_find_index_segs(), qo_find_index_terms(), qo_generate_index_scan(), qo_generate_join_index_scan(), qo_index_scan_new(), qo_insert_segment(), qo_node_add_sarg(), qo_optimize_helper(), qo_search_isnull_key_expr(), qo_search_partition_join(), qo_search_planner(), qo_seg_nodes(), qo_validate_index_attr_notnull(), and set_seg_node().
Definition at line 120 of file query_bitset.c.
References bitset_extend(), and NBYTES.
Referenced by add_hint(), gen_inner(), gen_outer(), make_mergelist_proc(), planner_permutate(), planner_visit_node(), qo_add_dep_term(), qo_alloc_info(), qo_alloc_planner(), qo_analyze_term(), qo_classify_outerjoin_terms(), qo_combine_partitions(), qo_compute_projected_segs(), qo_find_index_segs(), qo_follow_new(), qo_generate_index_scan(), qo_generate_join_index_scan(), qo_get_multi_col_range_segs(), qo_index_scan_new(), qo_join_new(), qo_scan_new(), qo_search_partition_join(), and qo_search_planner().
Definition at line 393 of file query_bitset.c.
References _WORD, BITSET_MEMBER, i, and nbits.
Referenced by get_term_rank(), make_mergelist_proc(), planner_visit_node(), qo_analyze_term(), qo_discover_edges(), qo_discover_partitions(), qo_discover_sort_limit_nodes(), qo_examine_idx_join(), qo_examine_nl_join(), qo_get_ils_prefix_length(), qo_get_xasl_index_info(), qo_index_covering_plans_cmp(), qo_is_iss_index(), qo_multi_range_opt_plans_cmp(), qo_plan_cmp(), qo_plan_compute_iscan_sort_list(), qo_plan_iscan_terms_cmp(), qo_plan_scan_print_json(), qo_plan_scan_print_text(), qo_scan_fprint(), qo_scan_info(), qo_search_partition(), qo_search_partition_join(), qo_top_plan_new(), and set_seg_expr().
void bitset_delset | ( | BITSET * | s | ) |
Definition at line 571 of file query_bitset.c.
References bitset_free, and NULL.
Referenced by gen_inner(), gen_outer(), get_local_subqueries_pre(), make_mergelist_proc(), planner_permutate(), planner_visit_node(), qo_analyze_term(), qo_assign_eq_classes(), qo_classify_outerjoin_terms(), qo_clean_planner(), qo_combine_partitions(), qo_compute_projected_segs(), qo_cp_new(), qo_discover_edges(), qo_discover_sort_limit_nodes(), qo_env_free(), qo_eqclass_free(), qo_examine_correlated_index(), qo_find_index_segs(), qo_find_node_indexes(), qo_free_index(), qo_free_info(), qo_generate_index_scan(), qo_generate_join_index_scan(), qo_generate_loose_index_scan(), qo_get_xasl_index_info(), qo_index_scan_new(), qo_join_free(), qo_join_new(), qo_node_free(), qo_optimize_helper(), qo_partition_free(), qo_plan_add_to_free_list(), qo_scan_free(), qo_search_partition_join(), qo_search_planner(), qo_seg_free(), qo_subquery_free(), qo_term_free(), and qo_validate_index_attr_notnull().
Definition at line 224 of file query_bitset.c.
Referenced by gen_outer(), make_pred_from_plan(), planner_permutate(), planner_visit_node(), qo_discover_sort_limit_join_nodes(), qo_discover_sort_limit_nodes(), qo_generate_join_index_scan(), qo_index_scan_new(), qo_join_new(), and qo_search_partition_join().
void bitset_extend | ( | BITSET * | dst, |
int | nwords | ||
) |
Definition at line 92 of file query_bitset.c.
References ARG_FILE_LINE, bitset_free, ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), NBYTES, and NULL.
Referenced by bitset_add(), bitset_assign(), and bitset_union().
Definition at line 514 of file query_bitset.c.
References bitset_iterate().
Referenced by make_mergelist_proc(), qo_add_dep_term(), qo_analyze_term(), qo_discover_edges(), qo_discover_sort_limit_nodes(), qo_examine_correlated_index(), qo_examine_idx_join(), qo_examine_merge_join(), qo_examine_nl_join(), qo_generate_index_scan(), qo_join_new(), qo_plan_cmp(), and qo_search_partition().
Definition at line 557 of file query_bitset.c.
References BITSET_CLEAR, and NWORDS.
Referenced by add_local_subquery(), gen_inner(), gen_outer(), get_local_subqueries_pre(), make_mergelist_proc(), planner_permutate(), planner_visit_node(), qo_alloc_index(), qo_alloc_info(), qo_alloc_planner(), qo_analyze_term(), qo_assign_eq_classes(), qo_classify_outerjoin_terms(), qo_combine_partitions(), qo_compute_projected_segs(), qo_cp_new(), qo_discover_edges(), qo_discover_sort_limit_join_nodes(), qo_discover_sort_limit_nodes(), qo_env_new(), qo_eqclass_new(), qo_examine_correlated_index(), qo_examine_merge_join(), qo_find_index_segs(), qo_find_node_indexes(), qo_generate_index_scan(), qo_generate_join_index_scan(), qo_generate_loose_index_scan(), qo_get_xasl_index_info(), qo_index_scan_new(), qo_join_new(), qo_node_clear(), qo_optimize_helper(), qo_partition_init(), qo_plan_malloc(), qo_scan_new(), qo_search_isnull_key_expr(), qo_search_partition_join(), qo_search_planner(), qo_seg_clear(), qo_term_clear(), and qo_validate_index_attr_notnull().
Definition at line 200 of file query_bitset.c.
Referenced by gen_outer(), make_mergelist_proc(), qo_compute_projected_segs(), qo_index_scan_new(), and qo_search_planner().
Definition at line 295 of file query_bitset.c.
Referenced by gen_outer(), planner_permutate(), qo_analyze_term(), qo_classify_outerjoin_terms(), qo_discover_edges(), qo_examine_correlated_index(), qo_examine_merge_join(), qo_examine_nl_join(), qo_find_index_terms(), qo_has_is_not_null_term(), qo_index_scan_new(), qo_join_new(), qo_search_isnull_key_expr(), qo_validate_index_attr_notnull(), and sort_partitions().
Definition at line 318 of file query_bitset.c.
Referenced by add_subqueries(), bitset_print(), gen_outer(), get_local_subqueries_pre(), is_after_join_term(), is_normal_access_term(), is_normal_if_term(), is_totally_after_join_term(), planner_permutate(), planner_visit_node(), qo_analyze_term(), qo_check_new_best_plan_on_info(), qo_combine_partitions(), qo_discover_partitions(), qo_dump_planner_info(), qo_eqclass_fprint_wrt(), qo_generate_join_index_scan(), qo_generate_loose_index_scan(), qo_index_scan_new(), qo_iscan_cost(), qo_join_fprint(), qo_join_info(), qo_node_dump(), qo_optimize_helper(), qo_plan_cmp_prefer_covering_index(), qo_plan_join_print_json(), qo_plan_join_print_text(), qo_plan_print_outer_join_terms(), qo_plan_print_sarged_terms(), qo_plan_print_subqueries(), qo_scan_fprint(), qo_search_partition_join(), qo_search_planner(), qo_seq_scan_new(), and qo_sort_new().
Definition at line 342 of file query_bitset.c.
Referenced by planner_visit_node(), qo_check_new_best_plan_on_info(), qo_classify_outerjoin_terms(), qo_discover_edges(), qo_join_new(), and qo_plan_iscan_terms_cmp().
int bitset_iterate | ( | const BITSET * | s, |
BITSET_ITERATOR * | si | ||
) |
Definition at line 464 of file query_bitset.c.
References bitset_next_member(), bitset_iterator::next, and bitset_iterator::set.
Referenced by add_subqueries(), bitset_first_member(), bitset_has_path(), bitset_print(), gen_outer(), make_mergelist_proc(), make_namelist_from_projected_segs(), make_outer_instnum(), make_pred_from_bitset(), planner_nodeset_join_cost(), planner_permutate(), planner_visit_node(), qo_add_dep_term(), qo_analyze_term(), qo_check_parent_eq_class_for_multi_range_opt(), qo_check_seg_belongs_to_range_term(), qo_check_subplan_join_cond_for_multi_range_opt(), qo_check_subqueries_for_multi_range_opt(), qo_check_terms_for_multiple_range_opt(), qo_classify_outerjoin_terms(), qo_combine_partitions(), qo_compute_projected_size(), qo_discover_edges(), qo_discover_indexes(), qo_discover_partitions(), qo_discover_sort_limit_join_nodes(), qo_discover_sort_limit_nodes(), qo_dump_planner_info(), qo_eqclass_dump(), qo_eqclass_wrt(), qo_examine_correlated_index(), qo_examine_merge_join(), qo_examine_nl_join(), qo_find_index_segs(), qo_generate_index_scan(), qo_generate_join_index_scan(), qo_get_multi_col_range_segs(), qo_get_xasl_index_info(), qo_index_scan_new(), qo_iscan_cost(), qo_join_info(), qo_nljoin_cost(), qo_plan_compute_cost(), qo_plan_compute_iscan_sort_list(), qo_plan_print_projected_segs(), qo_plan_scan_print_json(), qo_plan_scan_print_text(), qo_scan_info(), qo_search_partition_join(), qo_search_planner(), qo_seg_nodes(), qo_subquery_dump(), qo_term_string(), qo_termset_fprint(), and qo_top_plan_new().
int bitset_next_member | ( | BITSET_ITERATOR * | si | ) |
Definition at line 478 of file query_bitset.c.
References _BIT, _WORD, _WORDSIZE, bitset_iterator::next, and bitset_iterator::set.
Referenced by add_subqueries(), bitset_has_path(), bitset_iterate(), bitset_print(), gen_outer(), make_mergelist_proc(), make_namelist_from_projected_segs(), make_outer_instnum(), make_pred_from_bitset(), planner_nodeset_join_cost(), planner_permutate(), planner_visit_node(), qo_add_dep_term(), qo_analyze_term(), qo_check_parent_eq_class_for_multi_range_opt(), qo_check_seg_belongs_to_range_term(), qo_check_subplan_join_cond_for_multi_range_opt(), qo_check_subqueries_for_multi_range_opt(), qo_check_terms_for_multiple_range_opt(), qo_classify_outerjoin_terms(), qo_combine_partitions(), qo_compute_projected_size(), qo_discover_edges(), qo_discover_indexes(), qo_discover_partitions(), qo_discover_sort_limit_join_nodes(), qo_discover_sort_limit_nodes(), qo_dump_planner_info(), qo_eqclass_dump(), qo_eqclass_wrt(), qo_examine_correlated_index(), qo_examine_merge_join(), qo_examine_nl_join(), qo_find_index_segs(), qo_generate_index_scan(), qo_generate_join_index_scan(), qo_get_multi_col_range_segs(), qo_get_xasl_index_info(), qo_index_scan_new(), qo_iscan_cost(), qo_join_info(), qo_nljoin_cost(), qo_plan_compute_cost(), qo_plan_compute_iscan_sort_list(), qo_plan_print_projected_segs(), qo_plan_scan_print_json(), qo_plan_scan_print_text(), qo_scan_info(), qo_search_partition_join(), qo_search_planner(), qo_seg_nodes(), qo_subquery_dump(), qo_term_string(), qo_termset_fprint(), and qo_top_plan_new().
Definition at line 527 of file query_bitset.c.
References bitset_is_empty(), bitset_iterate(), bitset_next_member(), and i.
Referenced by qo_dump_info(), qo_node_dump(), qo_partition_dump(), qo_plan_print_subqueries(), qo_term_dump(), and qo_term_fprint().
void bitset_remove | ( | BITSET * | dst, |
int | x | ||
) |
Definition at line 158 of file query_bitset.c.
Referenced by planner_permutate(), planner_visit_node(), qo_classify_outerjoin_terms(), qo_combine_partitions(), qo_find_index_segs(), qo_follow_new(), qo_generate_index_scan(), qo_generate_join_index_scan(), qo_search_partition_join(), and qo_search_planner().
Definition at line 263 of file query_bitset.c.
Referenced by planner_permutate(), planner_visit_node(), qo_combine_partitions(), qo_discover_partitions(), qo_get_xasl_index_info(), qo_index_scan_new(), qo_plan_iscan_terms_cmp(), qo_search_partition(), qo_search_partition_join(), and qo_search_planner().
Definition at line 176 of file query_bitset.c.
References bitset_extend().
Referenced by gen_inner(), gen_outer(), planner_permutate(), planner_visit_node(), qo_analyze_term(), qo_assign_eq_classes(), qo_combine_partitions(), qo_compute_projected_segs(), qo_discover_edges(), qo_discover_partitions(), qo_discover_sort_limit_join_nodes(), qo_discover_sort_limit_nodes(), qo_examine_correlated_index(), qo_find_index_terms(), qo_follow_new(), qo_index_scan_new(), qo_join_new(), qo_search_partition_join(), and qo_search_planner().
BITSET EMPTY_SET = { NULL, empty_set_words, NWORDS, {{0}} } |
Definition at line 64 of file query_bitset.c.
Referenced by gen_inner(), gen_outer(), make_sort_limit_proc(), and qo_to_xasl().
|
static |
Definition at line 63 of file query_bitset.c.
|
static |
Definition at line 44 of file query_bitset.c.
Referenced by bitset_cardinality(), and qstr_ffs().