CUBRID Engine  latest
query_bitset.h File Reference
#include <stdio.h>
#include <string.h>
#include "optimizer.h"
Include dependency graph for query_bitset.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  bitset
 
struct  bitset_iterator
 

Macros

#define NELEMENTS   64
 
#define _LOG2_WORDSIZE   5
 
#define _WORDSIZE   32 /* Number of bits in BITSET_CARRIER */
 
#define _MASK   ((1L << _LOG2_WORDSIZE) - 1)
 
#define _WORD(x)   ((x) >> _LOG2_WORDSIZE)
 
#define _BIT(x)   ((x) & _MASK)
 
#define NWORDS
 
#define BITSET_CLEAR(s)
 
#define BITSET_MEMBER(s, x)
 
#define BITPATTERN(s)   ((s).setp[0])
 
#define BITSET_MOVE(dst, src)
 

Typedefs

typedef unsigned int BITSET_CARRIER
 
typedef struct bitset_iterator BITSET_ITERATOR
 

Functions

void bitset_extend (BITSET *dst, int nwords)
 
void bitset_assign (BITSET *, const BITSET *)
 
void bitset_add (BITSET *, int)
 
void bitset_remove (BITSET *, int)
 
void bitset_union (BITSET *, const BITSET *)
 
void bitset_intersect (BITSET *, const BITSET *)
 
void bitset_difference (BITSET *, const BITSET *)
 
int bitset_subset (const BITSET *, const BITSET *)
 
int bitset_intersects (const BITSET *, const BITSET *)
 
int bitset_is_empty (const BITSET *)
 
int bitset_is_equivalent (const BITSET *, const BITSET *)
 
int bitset_cardinality (const BITSET *)
 
int bitset_iterate (const BITSET *, BITSET_ITERATOR *)
 
int bitset_next_member (BITSET_ITERATOR *)
 
int bitset_first_member (const BITSET *)
 
void bitset_print (const BITSET *, FILE *fp)
 
void bitset_init (BITSET *, QO_ENV *)
 
void bitset_delset (BITSET *)
 

Variables

BITSET EMPTY_SET
 

Macro Definition Documentation

#define _BIT (   x)    ((x) & _MASK)

Definition at line 43 of file query_bitset.h.

Referenced by bitset_add(), bitset_next_member(), and bitset_remove().

#define _LOG2_WORDSIZE   5

Definition at line 39 of file query_bitset.h.

#define _MASK   ((1L << _LOG2_WORDSIZE) - 1)

Definition at line 41 of file query_bitset.h.

#define _WORD (   x)    ((x) >> _LOG2_WORDSIZE)

Definition at line 42 of file query_bitset.h.

Referenced by bitset_add(), bitset_cardinality(), bitset_next_member(), and bitset_remove().

#define _WORDSIZE   32 /* Number of bits in BITSET_CARRIER */

Definition at line 40 of file query_bitset.h.

Referenced by bitset_next_member(), and qo_discover_partitions().

#define BITPATTERN (   s)    ((s).setp[0])

Definition at line 72 of file query_bitset.h.

#define BITSET_MOVE (   dst,
  src 
)
Value:
do { \
(dst) = (src); \
if ((src).setp == (src).set.word) \
(dst).setp = (dst).set.word; \
} while(0)
if(extra_options)
Definition: dynamic_load.c:958

Definition at line 80 of file query_bitset.h.

Referenced by add_local_subquery().

#define NELEMENTS   64

Definition at line 37 of file query_bitset.h.

Referenced by qo_find_node_indexes().

#define NWORDS
Value:
(((NELEMENTS + (_WORDSIZE-1)) & ~(_WORDSIZE-1)) \
#define _LOG2_WORDSIZE
Definition: query_bitset.h:39
#define _WORDSIZE
Definition: query_bitset.h:40
#define NELEMENTS
Definition: query_bitset.h:37

Definition at line 45 of file query_bitset.h.

Referenced by bitset_init().

Typedef Documentation

typedef unsigned int BITSET_CARRIER

Definition at line 48 of file query_bitset.h.

Definition at line 49 of file query_bitset.h.

Function Documentation

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().

Here is the caller graph for this function:

void bitset_intersect ( BITSET ,
const BITSET  
)

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().

Here is the caller graph for this function:

int bitset_is_equivalent ( const BITSET ,
const BITSET  
)

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().

Here is the caller graph for this function:

int bitset_iterate ( const BITSET ,
BITSET_ITERATOR  
)

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 )

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().

void bitset_print ( const BITSET ,
FILE *  fp 
)

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().

Here is the caller graph for this function:

void bitset_remove ( BITSET ,
int   
)

Variable Documentation

BITSET EMPTY_SET

Definition at line 64 of file query_bitset.c.

Referenced by gen_inner(), gen_outer(), make_sort_limit_proc(), and qo_to_xasl().