CUBRID Engine
latest
|
#include <assert.h>
#include "partition_sr.h"
#include "dbtype.h"
#include "fetch.h"
#include "heap_file.h"
#include "object_primitive.h"
#include "object_representation.h"
#include "query_aggregate.hpp"
#include "query_executor.h"
#include "query_opfunc.h"
#include "stream_to_xasl.h"
#include "xasl.h"
#include "xasl_predicate.hpp"
#include "xasl_unpack_info.hpp"
Go to the source code of this file.
Classes | |
struct | pruning_bitset |
struct | pruning_bitset_iterator |
struct | partition_cache_entry |
Macros | |
#define | NELEMENTS 1024 /* maximum number of partitions */ |
#define | _WORDSIZE 8 * sizeof(int) |
#define | MAX_ELEMENTS 1024 |
#define | BITSET_WORD_SIZE sizeof (unsigned int) |
#define | BITS_IN_WORD (8 * BITSET_WORD_SIZE) |
#define | BITSET_WORD_COUNT (MAX_ELEMENTS / BITS_IN_WORD) |
#define | BITSET_LENGTH(s) ((((s)->count - 1) / BITS_IN_WORD)+1) |
#define | PARTITIONS_COUNT(pinfo) (((pinfo) == NULL) ? 0 : (pinfo)->count - 1) |
#define | PARTITION_CACHE_NAME "Partitions_Cache" |
#define | PARTITION_CACHE_SIZE 200 |
#define | PARTITION_IS_CACHE_INITIALIZED() (db_Partition_Ht != NULL) |
Typedefs | |
typedef enum match_status | MATCH_STATUS |
typedef enum pruning_op | PRUNING_OP |
typedef struct pruning_bitset | PRUNING_BITSET |
typedef struct pruning_bitset_iterator | PRUNING_BITSET_ITERATOR |
typedef struct partition_cache_entry | PARTITION_CACHE_ENTRY |
Enumerations | |
enum | match_status { MATCH_OK, MATCH_NOT_FOUND } |
enum | pruning_op { PO_INVALID = 0, PO_LT, PO_LE, PO_GT, PO_GE, PO_EQ, PO_NE, PO_IN, PO_NOT_IN, PO_IS_NULL } |
Variables | |
static MHT_TABLE * | db_Partition_Ht = NULL |
#define _WORDSIZE 8 * sizeof(int) |
Definition at line 60 of file partition.c.
#define BITS_IN_WORD (8 * BITSET_WORD_SIZE) |
Definition at line 64 of file partition.c.
Referenced by pruningset_add(), pruningset_is_set(), pruningset_iterator_next(), and pruningset_remove().
#define BITSET_LENGTH | ( | s | ) | ((((s)->count - 1) / BITS_IN_WORD)+1) |
Definition at line 66 of file partition.c.
Referenced by pruningset_copy(), pruningset_intersect(), pruningset_iterator_next(), pruningset_popcount(), and pruningset_union().
#define BITSET_WORD_COUNT (MAX_ELEMENTS / BITS_IN_WORD) |
Definition at line 65 of file partition.c.
Referenced by pruningset_init(), and pruningset_set_all().
#define BITSET_WORD_SIZE sizeof (unsigned int) |
Definition at line 63 of file partition.c.
Referenced by pruningset_init(), and pruningset_set_all().
#define MAX_ELEMENTS 1024 |
Definition at line 62 of file partition.c.
#define NELEMENTS 1024 /* maximum number of partitions */ |
Definition at line 59 of file partition.c.
#define PARTITION_CACHE_NAME "Partitions_Cache" |
Definition at line 84 of file partition.c.
Referenced by partition_cache_init().
#define PARTITION_CACHE_SIZE 200 |
Definition at line 85 of file partition.c.
Referenced by partition_cache_init().
#define PARTITION_IS_CACHE_INITIALIZED | ( | ) | (db_Partition_Ht != NULL) |
Definition at line 90 of file partition.c.
Referenced by partition_cache_finalize(), partition_cache_init(), partition_cache_pruning_context(), partition_decache_class(), and partition_load_context_from_cache().
#define PARTITIONS_COUNT | ( | pinfo | ) | (((pinfo) == NULL) ? 0 : (pinfo)->count - 1) |
Definition at line 82 of file partition.c.
Referenced by partition_find_partition_for_record(), partition_get_partition_oids(), partition_match_index_key(), partition_match_key_range(), partition_match_pred_expr(), partition_prune_hash(), partition_prune_heap_scan(), partition_prune_index_scan(), partition_prune_list(), partition_prune_partition_index(), partition_prune_range(), and partition_set_specified_partition().
typedef enum match_status MATCH_STATUS |
typedef struct partition_cache_entry PARTITION_CACHE_ENTRY |
Definition at line 92 of file partition.c.
typedef struct pruning_bitset PRUNING_BITSET |
Definition at line 68 of file partition.c.
typedef struct pruning_bitset_iterator PRUNING_BITSET_ITERATOR |
Definition at line 75 of file partition.c.
typedef enum pruning_op PRUNING_OP |
enum match_status |
Enumerator | |
---|---|
MATCH_OK | |
MATCH_NOT_FOUND |
Definition at line 39 of file partition.c.
enum pruning_op |
Enumerator | |
---|---|
PO_INVALID | |
PO_LT | |
PO_LE | |
PO_GT | |
PO_GE | |
PO_EQ | |
PO_NE | |
PO_IN | |
PO_NOT_IN | |
PO_IS_NULL |
Definition at line 45 of file partition.c.
|
static |
Definition at line 3826 of file partition.c.
References pruning_context::attr_id, pruning_context::attr_info, btree_attrinfo_read_dbvalues(), btree_read_key_type(), cleanup(), db_value::data, DB_PARTITIONED_CLASS, db_private_free_and_init, DB_TYPE_MIDXKEY, DB_VALUE_TYPE, db_midxkey::domain, ER_FAILED, error(), func_pred::func_regu, heap_attrinfo_start(), heap_get_indexinfo_of_btid(), pruning_context::is_attr_info_inited, db_data::midxkey, NO_ERROR, NULL, partition_clear_pruning_context(), partition_init_pruning_context(), partition_load_pruning_context(), pruning_context::partition_pred, partition_set_cache_info_for_expr(), pr_clone_value(), and pruning_context::root_oid.
Referenced by partition_prune_partition_index().
|
static |
Definition at line 447 of file partition.c.
References ARG_FILE_LINE, assert, pruning_context::attr_id, partition_cache_entry::attr_id, pruning_context::count, partition_cache_entry::count, ER_ERROR_SEVERITY, ER_FAILED, ER_GENERIC_ERROR, er_set(), pruning_context::error_code, NO_ERROR, NULL, pruning_context::partition_type, or_partition::partition_type, pruning_context::partitions, and partition_cache_entry::partitions.
Referenced by partition_load_context_from_cache().
void partition_cache_finalize | ( | THREAD_ENTRY * | thread_p | ) |
Definition at line 748 of file partition.c.
References ARG_FILE_LINE, csect_enter, csect_exit, CSECT_PARTITION_CACHE, er_log_debug, INF_WAIT, mht_destroy(), mht_map(), NO_ERROR, NULL, partition_free_cache_entry_kv(), and PARTITION_IS_CACHE_INITIALIZED.
Referenced by boot_server_all_finalize().
int partition_cache_init | ( | THREAD_ENTRY * | thread_p | ) |
Definition at line 711 of file partition.c.
References ARG_FILE_LINE, cleanup(), csect_enter, csect_exit, CSECT_PARTITION_CACHE, ER_FAILED, er_log_debug, error(), INF_WAIT, mht_create(), NO_ERROR, NULL, oid_compare_equals(), oid_hash(), PARTITION_CACHE_NAME, PARTITION_CACHE_SIZE, and PARTITION_IS_CACHE_INITIALIZED.
Referenced by boot_restart_server().
|
static |
Definition at line 575 of file partition.c.
References assert, partition_cache_entry::class_oid, csect_enter, csect_exit, CSECT_PARTITION_CACHE, ER_FAILED, INF_WAIT, log_is_class_being_modified(), mht_put_if_not_exists(), NO_ERROR, NULL, partition_free_cache_entry(), PARTITION_IS_CACHE_INITIALIZED, partition_pruning_context_to_cache_entry(), pruning_context::root_oid, and pruning_context::thread_p.
Referenced by partition_load_pruning_context().
void partition_clear_pruning_context | ( | PRUNING_CONTEXT * | pinfo | ) |
Definition at line 2380 of file partition.c.
References assert, pruning_context::attr_info, pruning_context::count, db_private_free, pruning_scan_cache::func_index_pred, heap_attrinfo_end(), heap_clear_partition_info(), heap_free_func_pred_unpack_info(), heap_scancache_end(), pruning_context::is_attr_info_inited, pruning_context::is_from_cache, pruning_scan_cache::is_scan_cache_started, pruning_scan_cache::n_indexes, scancache_list::next, NULL, partition_free_partition_predicate(), pruning_context::partitions, pruning_scan_cache::scan_cache, scancache_list::scan_cache, pruning_context::scan_cache_list, pruning_context::selected_partition, and pruning_context::thread_p.
Referenced by btree_check_foreign_key(), btree_load_check_fk(), locator_check_foreign_key(), logtb_tran_load_global_stats_func(), partition_attrinfo_get_key(), partition_get_partition_oids(), partition_load_aggregate_helper(), partition_load_pruning_context(), partition_prune_insert(), partition_prune_spec(), partition_prune_update(), qexec_clear_internal_classes(), qexec_execute_insert(), qexec_init_agg_hierarchy_helpers(), redistribute_partition_data(), and xbtree_find_multi_uniques().
void partition_decache_class | ( | THREAD_ENTRY * | thread_p, |
const OID * | class_oid | ||
) |
Definition at line 775 of file partition.c.
References csect_enter, csect_exit, CSECT_PARTITION_CACHE, INF_WAIT, mht_rem(), NO_ERROR, NULL, partition_free_cache_entry_kv(), and PARTITION_IS_CACHE_INITIALIZED.
Referenced by log_cleanup_modified_class().
Definition at line 3465 of file partition.c.
References db_data::bigint, db_value::data, db_datetime::date, db_data::date, db_datetimetz::datetime, db_data::datetime, db_data::datetimetz, DB_IS_NULL, DB_TYPE_BIGINT, DB_TYPE_DATE, DB_TYPE_DATETIME, DB_TYPE_DATETIMELTZ, DB_TYPE_DATETIMETZ, DB_TYPE_INTEGER, DB_TYPE_SHORT, DB_TYPE_TIME, DB_TYPE_TIMESTAMP, DB_TYPE_TIMESTAMPLTZ, DB_TYPE_TIMESTAMPTZ, DB_VALUE_TYPE, db_data::i, MILLISECONDS_OF_ONE_DAY, db_datetime::time, db_data::time, db_timestamptz::timestamp, db_data::timestamptz, and db_data::utime.
Referenced by partition_prune_range().
|
static |
Definition at line 968 of file partition.c.
References DB_EQ, val_descr::dbval_ptr, NULL, tp_value_compare(), TYPE_ATTR_ID, TYPE_CONSTANT, TYPE_DBVAL, TYPE_INARITH, TYPE_OUTARITH, TYPE_POS_VALUE, and pruning_context::vd.
Referenced by partition_match_pred_expr().
|
static |
Definition at line 3595 of file partition.c.
References ARG_FILE_LINE, assert, BTID_IS_NULL, cleanup(), ER_BTREE_INVALID_INDEX_ID, ER_ERROR_SEVERITY, er_set(), error(), vfid::fileid, free_and_init, heap_get_index_with_name(), heap_get_indexinfo_of_btid(), NO_ERROR, NULL, btid::root_pageid, btid::vfid, and vfid::volid.
Referenced by partition_prune_partition_index(), and partition_prune_unique_btid().
|
static |
Definition at line 2954 of file partition.c.
References ARG_FILE_LINE, assert, assert_release, pruning_context::attr_id, pruning_context::attr_info, or_partition::class_hfid, or_partition::class_oid, cleanup(), COPY_OID, pruning_bitset::count, db_value_is_null(), ER_ERROR_SEVERITY, ER_PARTITION_NOT_EXIST, er_set(), error(), pruning_context::error_code, fetch_peek_dbval(), func_pred::func_regu, heap_attrinfo_clear_dbvalues(), heap_attrinfo_read_dbvalues(), heap_attrinfo_start(), HFID_COPY, pruning_context::is_attr_info_inited, MATCH_NOT_FOUND, MATCH_OK, NO_ERROR, NULL, NULL_REPRID, OID_EQ, or_rep_id(), or_set_rep_id(), pruning_context::partition_pred, partition_prune_db_val(), partition_set_cache_info_for_expr(), pruning_context::partitions, PARTITIONS_COUNT, PO_EQ, PO_IS_NULL, pruningset_init(), pruningset_iterator_init(), pruningset_iterator_next(), pruningset_popcount(), or_partition::rep_id, pruning_context::root_oid, pruning_context::root_repr_id, and pruning_context::thread_p.
Referenced by partition_prune_insert(), and partition_prune_update().
int partition_find_root_class_oid | ( | THREAD_ENTRY * | thread_p, |
const OID * | class_oid, | ||
OID * | super_oid | ||
) |
Definition at line 2199 of file partition.c.
References ASSERT_ERROR, COPY_OID, error(), free_and_init, heap_get_class_supers(), NO_ERROR, NULL, and OID_SET_NULL.
Referenced by partition_load_pruning_context(), partition_prune_update(), and qexec_evaluate_aggregates_optimize().
|
static |
Definition at line 405 of file partition.c.
References partition_cache_entry::count, db_change_private_heap(), db_seq_free(), free_and_init, i, NO_ERROR, NULL, partition_cache_entry::partitions, and or_partition::values.
Referenced by partition_cache_pruning_context(), and partition_free_cache_entry_kv().
|
static |
Definition at line 389 of file partition.c.
References partition_free_cache_entry().
Referenced by partition_cache_finalize(), and partition_decache_class().
|
static |
Definition at line 2481 of file partition.c.
References pruning_context::fp_cache_context, free_xasl_unpack_info(), func_pred::func_regu, NULL, pruning_context::partition_pred, qexec_clear_partition_expression(), and pruning_context::thread_p.
Referenced by partition_clear_pruning_context(), and partition_load_pruning_context().
|
static |
Definition at line 2583 of file partition.c.
References assert, regu_variable_list_node::next, NULL, NULL_ATTRID, TYPE_ATTR_ID, TYPE_FUNC, TYPE_INARITH, TYPE_OUTARITH, and regu_variable_list_node::value.
Referenced by partition_load_pruning_context().
int partition_get_partition_oids | ( | THREAD_ENTRY * | thread_p, |
const OID * | class_oid, | ||
OID ** | partition_oids, | ||
int * | count | ||
) |
Definition at line 3380 of file partition.c.
References assert_release, or_partition::class_oid, cleanup(), COPY_OID, pruning_context::count, DB_PARTITIONED_CLASS, db_private_alloc, db_private_free, ER_FAILED, error(), or_classrep::has_partition_info, heap_classrepr_free_and_init, heap_classrepr_get(), i, NO_ERROR, NULL, NULL_REPRID, partition_clear_pruning_context(), partition_init_pruning_context(), partition_load_pruning_context(), pruning_context::partitions, and PARTITIONS_COUNT.
Referenced by catalog_get_cardinality(), and xstats_update_statistics().
|
static |
Definition at line 2656 of file partition.c.
References ASSERT_ERROR, pruning_context::attr_position, db_private_free, error(), func_pred::func_regu, heap_get_indexinfo_of_btid(), i, NO_ERROR, NULL, pruning_context::partition_pred, pruning_context::root_oid, pruning_context::thread_p, and TYPE_ATTR_ID.
Referenced by partition_load_aggregate_helper(), and partition_prune_spec().
PRUNING_SCAN_CACHE* partition_get_scancache | ( | PRUNING_CONTEXT * | pcontext, |
const OID * | partition_oid | ||
) |
Definition at line 3320 of file partition.c.
References assert_release, heap_scancache_node::class_oid, scancache_list::next, heap_scancache::node, NULL, OID_EQ, pruning_scan_cache::scan_cache, scancache_list::scan_cache, and pruning_context::scan_cache_list.
Referenced by locator_get_partition_scancache().
|
static |
Definition at line 1784 of file partition.c.
References assert_release, db_make_null(), error(), fetch_peek_dbval(), NO_ERROR, NULL, partition_is_reguvar_const(), pr_clone_value(), pruning_context::thread_p, TYPE_INARITH, and pruning_context::vd.
Referenced by partition_get_value_from_regu_var().
|
static |
Definition at line 1683 of file partition.c.
References ARG_FILE_LINE, assert, pruning_context::attr_position, db_make_null(), val_descr::dbval_ptr, ER_ERROR_SEVERITY, ER_FAILED, ER_GENERIC_ERROR, er_set(), error(), F_MIDXKEY, i, regu_variable_list_node::next, NO_ERROR, NULL, partition_get_value_from_regu_var(), pr_clone_value(), TYPE_CONSTANT, TYPE_DBVAL, TYPE_FUNC, TYPE_INARITH, TYPE_POS_VALUE, regu_variable_list_node::value, and pruning_context::vd.
Referenced by partition_get_value_from_regu_var().
|
static |
Definition at line 1560 of file partition.c.
References assert, db_make_null(), val_descr::dbval_ptr, ER_FAILED, error(), F_MIDXKEY, if(), NO_ERROR, NULL, partition_get_value_from_inarith(), partition_get_value_from_key(), pr_clone_value(), TYPE_DBVAL, TYPE_FUNC, TYPE_INARITH, TYPE_POS_VALUE, and pruning_context::vd.
Referenced by partition_get_value_from_key(), and partition_prune().
void partition_init_pruning_context | ( | PRUNING_CONTEXT * | pinfo | ) |
Definition at line 2164 of file partition.c.
References assert, pruning_context::attr_position, pruning_context::count, DB_PARTITIONED_CLASS, pruning_context::error_code, pruning_context::fp_cache_context, pruning_context::is_attr_info_inited, pruning_context::is_from_cache, NO_ERROR, NULL, OID_SET_NULL, pruning_context::partition_pred, pruning_context::partitions, pruning_context::pruning_type, pruning_context::root_oid, pruning_context::scan_cache_list, pruning_context::selected_partition, pruning_context::spec, pruning_context::thread_p, and pruning_context::vd.
Referenced by btree_check_foreign_key(), btree_load_check_fk(), locator_check_foreign_key(), logtb_tran_load_global_stats_func(), partition_attrinfo_get_key(), partition_get_partition_oids(), partition_load_aggregate_helper(), partition_load_pruning_context(), partition_prune_insert(), partition_prune_spec(), partition_prune_update(), qexec_create_internal_classes(), qexec_execute_insert(), qexec_init_agg_hierarchy_helpers(), redistribute_partition_data(), and xbtree_find_multi_uniques().
|
static |
Definition at line 1637 of file partition.c.
References arith_list_node::leftptr, NULL, arith_list_node::rightptr, arith_list_node::thirdptr, TYPE_DBVAL, TYPE_INARITH, TYPE_OUTARITH, TYPE_POS_VALUE, TYPE_REGUVAL_LIST, and arith_list_node::value.
Referenced by partition_get_value_from_inarith().
int partition_load_aggregate_helper | ( | PRUNING_CONTEXT * | pcontext, |
access_spec_node * | spec, | ||
int | pruned_count, | ||
BTID * | root_btid, | ||
HIERARCHY_AGGREGATE_HELPER * | helper | ||
) |
Definition at line 3639 of file partition.c.
References assert, assert_release, pruning_context::attr_position, BTID_IS_NULL, cubquery::hierarchy_aggregate_helper::btids, btree_is_unique_type(), BTREE_PRIMARY_KEY, cleanup(), pruning_context::count, cubquery::hierarchy_aggregate_helper::count, DB_PARTITIONED_CLASS, db_private_alloc, db_private_free_and_init, ER_OUT_OF_VIRTUAL_MEMORY, error(), free_and_init, heap_get_index_with_name(), heap_get_indexinfo_of_btid(), HFID_COPY, cubquery::hierarchy_aggregate_helper::hfids, i, NO_ERROR, NULL, partition_clear_pruning_context(), partition_get_position_in_key(), partition_init_pruning_context(), partition_load_pruning_context(), access_spec_node::pruning_type, pruning_context::root_oid, and pruning_context::thread_p.
Referenced by qexec_init_agg_hierarchy_helpers().
|
static |
Definition at line 647 of file partition.c.
References assert, csect_enter_as_reader, csect_exit, CSECT_PARTITION_CACHE, ER_FAILED, pruning_context::error_code, INF_WAIT, pruning_context::is_from_cache, log_is_class_being_modified(), mht_get(), NO_ERROR, NULL, partition_cache_entry_to_pruning_context(), PARTITION_IS_CACHE_INITIALIZED, pruning_context::root_oid, and pruning_context::thread_p.
Referenced by partition_load_pruning_context().
|
static |
Definition at line 2437 of file partition.c.
References ARG_FILE_LINE, assert, ASSERT_ERROR, CONST_CAST, db_get_string(), db_get_string_size(), db_set_get(), db_set_size(), DB_TYPE_CHAR, DB_VALUE_TYPE, ER_ERROR_SEVERITY, ER_FAILED, ER_GENERIC_ERROR, er_set(), error(), pruning_context::fp_cache_context, NO_ERROR, NULL, pruning_context::partition_pred, pr_clear_value(), stx_map_stream_to_func_pred(), pruning_context::thread_p, and or_partition::values.
Referenced by partition_load_pruning_context().
int partition_load_pruning_context | ( | THREAD_ENTRY * | thread_p, |
const OID * | class_oid, | ||
int | pruning_type, | ||
PRUNING_CONTEXT * | pinfo | ||
) |
Definition at line 2249 of file partition.c.
References assert, ASSERT_ERROR, assert_release, pruning_context::attr_id, COPY_OID, pruning_context::count, DB_PARTITION_CLASS, DB_PARTITIONED_CLASS, ER_FAILED, error(), pruning_context::error_code, func_pred::func_regu, heap_clear_partition_info(), heap_get_class_partitions(), pruning_context::is_from_cache, NO_ERROR, NULL, partition_cache_pruning_context(), partition_clear_pruning_context(), partition_find_root_class_oid(), partition_free_partition_predicate(), partition_get_attribute_id(), partition_init_pruning_context(), partition_load_context_from_cache(), partition_load_partition_predicate(), pruning_context::partition_pred, partition_set_specified_partition(), pruning_context::partition_type, or_partition::partition_type, pruning_context::partitions, pruning_context::pruning_type, or_partition::rep_id, pruning_context::root_oid, pruning_context::root_repr_id, and pruning_context::thread_p.
Referenced by btree_check_foreign_key(), btree_load_check_fk(), locator_check_foreign_key(), logtb_tran_load_global_stats_func(), partition_attrinfo_get_key(), partition_get_partition_oids(), partition_load_aggregate_helper(), partition_prune_insert(), partition_prune_spec(), partition_prune_update(), qexec_create_internal_classes(), qexec_execute_insert(), qexec_init_agg_hierarchy_helpers(), redistribute_partition_data(), and xbtree_find_multi_uniques().
|
static |
Definition at line 2122 of file partition.c.
References func_pred::func_regu, i, key_info::key_cnt, key_info::key_ranges, MATCH_NOT_FOUND, MATCH_OK, partition_match_key_range(), pruning_context::partition_pred, PARTITIONS_COUNT, pruningset_init(), pruningset_set_all(), pruningset_union(), and TYPE_ATTR_ID.
Referenced by partition_prune_index_scan().
|
static |
Definition at line 1981 of file partition.c.
References EQ_NA, pruning_context::error_code, GE_INF, GE_LE, GE_LT, GT_INF, GT_LE, GT_LT, INF_INF, INF_LE, INF_LT, key_range::key1, key_range::key2, LE_GE, LE_GT, LT_GE, LT_GT, MATCH_NOT_FOUND, MATCH_OK, NA_NA, NEQ_NA, NO_ERROR, partition_prune(), PARTITIONS_COUNT, PO_EQ, PO_GE, PO_GT, PO_INVALID, PO_LE, PO_LT, pruningset_copy(), pruningset_init(), pruningset_intersect(), and key_range::range.
Referenced by partition_match_index_key().
|
static |
Definition at line 1829 of file partition.c.
References assert, B_AND, B_OR, cubxasl::pred::bool_op, cubxasl::alsm_eval_term::elem, cubxasl::alsm_eval_term::elemset, cubxasl::alsm_eval_term::eq_flag, cubxasl::eval_term::et, cubxasl::eval_term::et_alsm, cubxasl::eval_term::et_comp, cubxasl::eval_term::et_type, F_SOME, func_pred::func_regu, cubxasl::pred::lhs, cubxasl::comp_eval_term::lhs, cubxasl::pred_expr::m_eval_term, cubxasl::pred_expr::m_pred, MATCH_NOT_FOUND, MATCH_OK, NULL, partition_do_regu_variables_match(), pruning_context::partition_pred, partition_prune(), partition_rel_op_to_pruning_op(), PARTITIONS_COUNT, cubxasl::pred_expr::pe, PO_EQ, PO_IN, PO_NE, PO_NOT_IN, pruningset_copy(), pruningset_init(), pruningset_intersect(), pruningset_union(), cubxasl::comp_eval_term::rel_op, cubxasl::alsm_eval_term::rel_op, cubxasl::pred::rhs, cubxasl::comp_eval_term::rhs, T_ALSM_EVAL_TERM, T_COMP_EVAL_TERM, T_EVAL_TERM, T_LIKE_EVAL_TERM, T_NOT_TERM, T_PRED, T_RLIKE_EVAL_TERM, and cubxasl::pred_expr::type.
Referenced by partition_prune_heap_scan(), and partition_prune_index_scan().
PRUNING_SCAN_CACHE* partition_new_scancache | ( | PRUNING_CONTEXT * | pcontext | ) |
Definition at line 3350 of file partition.c.
References db_private_alloc, pruning_scan_cache::func_index_pred, pruning_scan_cache::is_scan_cache_started, pruning_scan_cache::n_indexes, scancache_list::next, NULL, scancache_list::scan_cache, pruning_context::scan_cache_list, and pruning_context::thread_p.
Referenced by locator_get_partition_scancache().
|
static |
Definition at line 1515 of file partition.c.
References db_make_null(), ER_FAILED, pruning_context::error_code, MATCH_NOT_FOUND, NO_ERROR, NULL, partition_get_value_from_regu_var(), partition_prune_db_val(), PO_IS_NULL, and pr_clear_value().
Referenced by partition_match_key_range(), and partition_match_pred_expr().
|
static |
Definition at line 1486 of file partition.c.
References DB_PARTITION_HASH, DB_PARTITION_LIST, DB_PARTITION_RANGE, MATCH_NOT_FOUND, partition_prune_hash(), partition_prune_list(), partition_prune_range(), and pruning_context::partition_type.
Referenced by partition_find_partition_for_record(), partition_prune(), and partition_prune_partition_index().
|
static |
Definition at line 1212 of file partition.c.
References cleanup(), db_get_set(), db_make_null(), db_set_get(), db_set_size(), DB_VALUE_TYPE, db_value_type_is_collection(), DOMAIN_INCOMPATIBLE, er_clear(), ER_FAILED, pruning_context::error_code, func_pred::func_regu, i, MATCH_NOT_FOUND, MATCH_OK, mht_get_hash_number(), NO_ERROR, NULL, pruning_context::partition_pred, PARTITIONS_COUNT, PO_EQ, PO_IN, PO_IS_NULL, pr_clear_value(), pr_clone_value(), pruningset_add(), TP_DOMAIN_TYPE, and tp_value_cast().
Referenced by partition_prune_db_val().
|
static |
Definition at line 2709 of file partition.c.
References assert, ASSERT_ERROR, error(), pruning_context::error_code, MATCH_NOT_FOUND, NO_ERROR, NULL, partition_match_pred_expr(), pruning_context::partitions, PARTITIONS_COUNT, pruningset_init(), pruningset_set_all(), pruningset_to_spec_list(), pruning_context::spec, and access_spec_node::where_pred.
Referenced by partition_prune_spec().
|
static |
Definition at line 2762 of file partition.c.
References assert, ASSERT_ERROR, pruning_context::attr_position, error(), pruning_context::error_code, indx_info::func_idx_col_id, access_spec_node::indexptr, indx_info::key_info, MATCH_NOT_FOUND, MATCH_OK, NO_ERROR, NULL, partition_match_index_key(), partition_match_pred_expr(), pruning_context::partitions, PARTITIONS_COUNT, pruningset_init(), pruningset_set_all(), pruningset_to_spec_list(), indx_info::range_type, pruning_context::spec, indx_info::use_iss, access_spec_node::where_key, and access_spec_node::where_pred.
Referenced by partition_prune_spec().
int partition_prune_insert | ( | THREAD_ENTRY * | thread_p, |
const OID * | class_oid, | ||
RECDES * | recdes, | ||
HEAP_SCANCACHE * | scan_cache, | ||
PRUNING_CONTEXT * | pcontext, | ||
int | pruning_type, | ||
OID * | pruned_class_oid, | ||
HFID * | pruned_hfid, | ||
OID * | superclass_oid | ||
) |
Definition at line 3092 of file partition.c.
References ARG_FILE_LINE, assert, or_partition::class_oid, cleanup(), COPY_OID, DB_NOT_PARTITIONED_CLASS, DB_PARTITION_CLASS, ER_ERROR_SEVERITY, ER_INVALID_DATA_FOR_PARTITION, er_set(), error(), NO_ERROR, NULL, OID_EQ, OID_SET_NULL, partition_clear_pruning_context(), partition_find_partition_for_record(), partition_init_pruning_context(), partition_load_pruning_context(), pruning_context::partitions, pruning_context::root_oid, and pruning_context::selected_partition.
Referenced by locator_insert_force().
|
static |
Definition at line 1077 of file partition.c.
References db_get_set(), db_set_get(), db_set_has_null(), db_set_ismember(), db_set_size(), db_value_type_is_collection(), i, MATCH_NOT_FOUND, MATCH_OK, NULL, pruning_context::partitions, PARTITIONS_COUNT, PO_EQ, PO_GE, PO_GT, PO_IN, PO_IS_NULL, PO_LE, PO_LT, PO_NE, PO_NOT_IN, pr_clear_value(), pruningset_add(), and or_partition::values.
Referenced by partition_prune_db_val().
int partition_prune_partition_index | ( | PRUNING_CONTEXT * | pcontext, |
DB_VALUE * | key, | ||
OID * | class_oid, | ||
BTID * | btid, | ||
int * | position | ||
) |
Definition at line 3926 of file partition.c.
References assert, assert_release, DB_PARTITION_CLASS, ER_FAILED, error(), MATCH_NOT_FOUND, NO_ERROR, NULL, OID_SET_NULL, partition_attrinfo_get_key(), partition_find_inherited_btid(), partition_prune_db_val(), PARTITIONS_COUNT, PO_EQ, pr_clear_value(), pruning_context::pruning_type, pruningset_init(), pruningset_iterator_init(), pruningset_iterator_next(), pruningset_popcount(), pruning_context::root_oid, and pruning_context::thread_p.
Referenced by btree_load_check_fk(), and partition_prune_unique_btid().
|
static |
Definition at line 1331 of file partition.c.
References cleanup(), DB_EQ, DB_IS_NULL, DB_LT, db_make_null(), db_set_get(), DB_UNK, error(), pruning_context::error_code, i, MATCH_NOT_FOUND, MATCH_OK, max, min, NO_ERROR, partition_decrement_value(), pruning_context::partitions, PARTITIONS_COUNT, PO_EQ, PO_GE, PO_GT, PO_IS_NULL, PO_LE, PO_LT, pr_clear_value(), pruningset_add(), tp_value_compare(), and or_partition::values.
Referenced by partition_prune_db_val().
int partition_prune_spec | ( | THREAD_ENTRY * | thread_p, |
val_descr * | vd, | ||
access_spec_node * | spec | ||
) |
Definition at line 2841 of file partition.c.
References access_spec_node::access, ACCESS_METHOD_SEQUENTIAL, ACCESS_METHOD_SEQUENTIAL_PAGE_SCAN, ACCESS_METHOD_SEQUENTIAL_RECORD_INFO, ACCESS_SPEC_CLS_OID, ARG_FILE_LINE, assert, ASSERT_ERROR, pruning_context::attr_position, indx_info::btid, DB_PARTITIONED_CLASS, ER_ERROR_SEVERITY, ER_FAILED, ER_GENERIC_ERROR, er_set(), error(), func_pred::func_regu, access_spec_node::indexptr, NO_ERROR, NULL, partition_clear_pruning_context(), partition_get_position_in_key(), partition_init_pruning_context(), partition_load_pruning_context(), pruning_context::partition_pred, partition_prune_heap_scan(), partition_prune_index_scan(), pruning_context::partitions, access_spec_node::pruning_type, pruning_context::spec, TARGET_CLASS, TARGET_CLASS_ATTR, access_spec_node::type, TYPE_ATTR_ID, and pruning_context::vd.
Referenced by qexec_execute_obj_fetch(), and qexec_prune_spec().
int partition_prune_unique_btid | ( | PRUNING_CONTEXT * | pcontext, |
DB_VALUE * | key, | ||
OID * | class_oid, | ||
HFID * | class_hfid, | ||
BTID * | btid | ||
) |
Definition at line 3553 of file partition.c.
References BTID_COPY, or_partition::class_hfid, or_partition::class_oid, COPY_OID, error(), HFID_COPY, NO_ERROR, partition_find_inherited_btid(), partition_prune_partition_index(), pruning_context::partitions, pruning_context::root_oid, and pruning_context::thread_p.
Referenced by btree_check_foreign_key(), btree_load_check_fk(), locator_check_foreign_key(), qexec_oid_of_duplicate_key_update(), qexec_remove_duplicates_for_replace(), and xbtree_find_multi_uniques().
int partition_prune_update | ( | THREAD_ENTRY * | thread_p, |
const OID * | class_oid, | ||
RECDES * | recdes, | ||
PRUNING_CONTEXT * | pcontext, | ||
int | pruning_type, | ||
OID * | pruned_class_oid, | ||
HFID * | pruned_hfid, | ||
OID * | superclass_oid | ||
) |
Definition at line 3199 of file partition.c.
References ARG_FILE_LINE, assert, or_partition::class_oid, cleanup(), COPY_OID, DB_NOT_PARTITIONED_CLASS, DB_PARTITION_CLASS, ER_ERROR_SEVERITY, ER_FAILED, ER_GENERIC_ERROR, ER_INVALID_DATA_FOR_PARTITION, er_set(), error(), NO_ERROR, NULL, OID_EQ, OID_IS_ROOTOID, OID_ISNULL, OID_SET_NULL, partition_clear_pruning_context(), partition_find_partition_for_record(), partition_find_root_class_oid(), partition_init_pruning_context(), partition_load_pruning_context(), pruning_context::partitions, pruning_context::pruning_type, pruning_context::root_oid, and pruning_context::selected_partition.
Referenced by locator_update_force().
|
static |
Definition at line 477 of file partition.c.
References ARG_FILE_LINE, assert, pruning_context::attr_id, partition_cache_entry::attr_id, or_partition::class_hfid, partition_cache_entry::class_oid, or_partition::class_oid, COPY_OID, pruning_context::count, partition_cache_entry::count, db_change_private_heap(), db_seq_copy(), db_seq_free(), ER_ERROR_SEVERITY, ER_FAILED, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), pruning_context::error_code, free_and_init, HFID_COPY, i, NULL, or_partition::partition_type, pruning_context::partitions, partition_cache_entry::partitions, or_partition::rep_id, pruning_context::root_oid, pruning_context::thread_p, and or_partition::values.
Referenced by partition_cache_pruning_context().
|
static |
Definition at line 798 of file partition.c.
References PO_EQ, PO_GE, PO_GT, PO_IN, PO_INVALID, PO_IS_NULL, PO_LE, PO_LT, PO_NE, PO_NOT_IN, R_EQ, R_EQ_ALL, R_EQ_SOME, R_EQ_TORDER, R_EXISTS, R_GE, R_GE_ALL, R_GE_SOME, R_GT, R_GT_ALL, R_GT_SOME, R_LE, R_LE_ALL, R_LE_SOME, R_LIKE, R_LT, R_LT_ALL, R_LT_SOME, R_NE, R_NE_ALL, R_NE_SOME, R_NULL, R_NULLSAFE_EQ, R_SUBSET, R_SUBSETEQ, R_SUPERSET, and R_SUPERSETEQ.
Referenced by partition_match_pred_expr().
|
static |
Definition at line 2527 of file partition.c.
References assert, regu_variable_list_node::next, NULL, NULL_ATTRID, TYPE_ATTR_ID, TYPE_FUNC, TYPE_INARITH, TYPE_OUTARITH, and regu_variable_list_node::value.
Referenced by partition_attrinfo_get_key(), and partition_find_partition_for_record().
|
static |
Definition at line 2504 of file partition.c.
References assert_release, or_partition::class_oid, i, NULL, OID_EQ, pruning_context::partitions, PARTITIONS_COUNT, and pruning_context::selected_partition.
Referenced by partition_load_pruning_context().
|
static |
Definition at line 221 of file partition.c.
References BITS_IN_WORD, and pruning_bitset::set.
Referenced by partition_prune_hash(), partition_prune_list(), and partition_prune_range().
|
static |
Definition at line 202 of file partition.c.
References BITSET_LENGTH, pruning_bitset::count, i, pruningset_init(), and pruning_bitset::set.
Referenced by partition_match_key_range(), and partition_match_pred_expr().
|
static |
Definition at line 178 of file partition.c.
References BITSET_WORD_COUNT, BITSET_WORD_SIZE, pruning_bitset::count, and pruning_bitset::set.
Referenced by partition_find_partition_for_record(), partition_match_index_key(), partition_match_key_range(), partition_match_pred_expr(), partition_prune_heap_scan(), partition_prune_index_scan(), partition_prune_partition_index(), and pruningset_copy().
|
static |
Definition at line 246 of file partition.c.
References BITSET_LENGTH, i, and pruning_bitset::set.
Referenced by partition_match_key_range(), and partition_match_pred_expr().
|
static |
Definition at line 286 of file partition.c.
References BITS_IN_WORD, and pruning_bitset::set.
|
static |
Definition at line 328 of file partition.c.
References pruning_bitset_iterator::next, and pruning_bitset_iterator::set.
Referenced by partition_find_partition_for_record(), partition_prune_partition_index(), and pruningset_to_spec_list().
|
static |
Definition at line 340 of file partition.c.
References BITS_IN_WORD, BITSET_LENGTH, pruning_bitset::count, i, pruning_bitset_iterator::next, pruning_bitset::set, and pruning_bitset_iterator::set.
Referenced by partition_find_partition_for_record(), partition_prune_partition_index(), and pruningset_to_spec_list().
|
static |
Definition at line 298 of file partition.c.
References BITSET_LENGTH, pruning_bitset::count, i, and pruning_bitset::set.
Referenced by partition_find_partition_for_record(), partition_prune_partition_index(), and pruningset_to_spec_list().
|
static |
Definition at line 233 of file partition.c.
References BITS_IN_WORD, and pruning_bitset::set.
|
static |
Definition at line 190 of file partition.c.
References BITSET_WORD_COUNT, BITSET_WORD_SIZE, and pruning_bitset::set.
Referenced by partition_match_index_key(), partition_prune_heap_scan(), and partition_prune_index_scan().
|
static |
Definition at line 864 of file partition.c.
References access_spec_node::access, ACCESS_METHOD_INDEX, ACCESS_METHOD_INDEX_KEY_INFO, ACCESS_SPEC_CLS_OID, assert, ASSERT_ERROR, indx_info::btid, or_partition::class_hfid, or_partition::class_oid, cleanup(), COPY_OID, db_private_alloc, db_private_free, ER_FAILED, error(), free_and_init, heap_get_index_with_name(), heap_get_indexinfo_of_btid(), HFID_COPY, i, access_spec_node::indexptr, NO_ERROR, NULL, pruning_context::partitions, pruningset_iterator_init(), pruningset_iterator_next(), pruningset_popcount(), pruning_context::spec, and pruning_context::thread_p.
Referenced by partition_prune_heap_scan(), and partition_prune_index_scan().
|
static |
Definition at line 263 of file partition.c.
References BITSET_LENGTH, i, max, and pruning_bitset::set.
Referenced by partition_match_index_key(), and partition_match_pred_expr().
Definition at line 88 of file partition.c.