CUBRID Engine  latest
statistics_sr.c File Reference
#include "config.h"
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "statistics_sr.h"
#include "btree.h"
#include "heap_file.h"
#include "boot_sr.h"
#include "partition_sr.h"
#include "object_primitive.h"
#include "object_representation.h"
#include "thread_entry.hpp"
#include "system_parameter.h"
Include dependency graph for statistics_sr.c:

Go to the source code of this file.

Classes

struct  class_id_list
 
struct  partition_stats_acumulator
 

Macros

#define SQUARE(n)   ((n)*(n))
 

Typedefs

typedef struct class_id_list CLASS_ID_LIST
 
typedef struct partition_stats_acumulator PARTITION_STATS_ACUMULATOR
 

Functions

static int stats_update_partitioned_statistics (THREAD_ENTRY *thread_p, OID *class_oid, OID *partitions, int count, bool with_fullscan)
 
int xstats_update_statistics (THREAD_ENTRY *thread_p, OID *class_id_p, bool with_fullscan)
 
int xstats_update_all_statistics (THREAD_ENTRY *thread_p, bool with_fullscan)
 
char * xstats_get_statistics_from_server (THREAD_ENTRY *thread_p, OID *class_id_p, unsigned int time_stamp, int *length_p)
 
unsigned int stats_get_time_stamp (void)
 
const BTREE_STATSstats_find_inherited_index_stats (OR_CLASSREP *cls_rep, OR_CLASSREP *subcls_rep, DISK_ATTR *subcls_attr, BTID *cls_btid)
 

Macro Definition Documentation

#define SQUARE (   n)    ((n)*(n))

Definition at line 42 of file statistics_sr.c.

Referenced by stats_update_partitioned_statistics().

Typedef Documentation

typedef struct class_id_list CLASS_ID_LIST

Definition at line 46 of file statistics_sr.c.

Definition at line 53 of file statistics_sr.c.

Function Documentation

const BTREE_STATS* stats_find_inherited_index_stats ( OR_CLASSREP cls_rep,
OR_CLASSREP subcls_rep,
DISK_ATTR subcls_attr,
BTID cls_btid 
)
static int stats_update_partitioned_statistics ( THREAD_ENTRY thread_p,
OID class_oid,
OID partitions,
int  count,
bool  with_fullscan 
)
static

Definition at line 1223 of file statistics_sr.c.

References assert, ASSERT_ERROR_AND_SET, assert_release, disk_attribute::bt_stats, btree_stats::btid, BTREE_STATS_PKEYS_NUM, CATALOG_ACCESS_INFO_INITIALIZER, catalog_add_class_info(), catalog_add_representation(), catalog_end_access_with_dir_oid(), catalog_free_class_info_and_init, catalog_free_representation_and_init, catalog_get_class_info(), catalog_get_dir_oid_from_cache(), catalog_get_last_representation_id(), catalog_get_representation(), catalog_start_access_with_dir_oid(), cls_info::ci_rep_dir, cls_info::ci_time_stamp, cls_info::ci_tot_objects, cls_info::ci_tot_pages, catalog_access_info::class_oid, cleanup(), db_private_alloc, db_private_free, db_private_free_and_init, catalog_access_info::dir_oid, er_errid(), ER_FAILED, error(), disk_representation::fixed, heap_classrepr_free_and_init, heap_classrepr_get(), partition_stats_acumulator::height, btree_stats::height, i, disk_attribute::id, partition_stats_acumulator::keys, btree_stats::keys, partition_stats_acumulator::leafs, btree_stats::leafs, disk_attribute::n_btstats, disk_representation::n_fixed, disk_representation::n_variable, NO_ERROR, NULL, NULL_REPRID, OID_ISNULL, partition_stats_acumulator::pages, btree_stats::pages, partition_stats_acumulator::pkeys, btree_stats::pkeys, partition_stats_acumulator::pkeys_size, btree_stats::pkeys_size, S_LOCK, SQUARE, stats_find_inherited_index_stats(), stats_get_time_stamp(), disk_representation::variable, X_LOCK, and xstats_update_statistics().

Referenced by xstats_update_statistics().

Here is the caller graph for this function:

char* xstats_get_statistics_from_server ( THREAD_ENTRY thread_p,
OID class_id_p,
unsigned int  time_stamp,
int *  length_p 
)

Definition at line 443 of file statistics_sr.c.

References catalog_access_info::access_started, db_monetary::amount, ARG_FILE_LINE, assert, ASSERT_ERROR_AND_SET, assert_release, db_data::bigint, disk_attribute::bt_stats, btree_stats::btid, BTREE_STATS_PKEYS_NUM, CAST_STRLEN, CATALOG_ACCESS_INFO_INITIALIZER, catalog_end_access_with_dir_oid(), catalog_free_class_info_and_init, catalog_free_representation_and_init, catalog_get_class_info(), catalog_get_dir_oid_from_cache(), catalog_get_last_representation_id(), catalog_get_representation(), catalog_start_access_with_dir_oid(), cls_info::ci_hfid, cls_info::ci_time_stamp, cls_info::ci_tot_objects, cls_info::ci_tot_pages, catalog_access_info::class_oid, db_data::d, db_datetime::date, db_data::date, db_datetimetz::datetime, db_data::datetime, db_data::datetimetz, DB_EQ, DB_GT, DB_LT, DB_TYPE_BIGINT, DB_TYPE_DATE, DB_TYPE_DATETIME, DB_TYPE_DATETIMELTZ, DB_TYPE_DATETIMETZ, DB_TYPE_DOUBLE, DB_TYPE_FLOAT, DB_TYPE_INTEGER, DB_TYPE_MIDXKEY, DB_TYPE_MONETARY, DB_TYPE_SHORT, DB_TYPE_TIME, DB_TYPE_TIMESTAMP, DB_TYPE_TIMESTAMPLTZ, DB_TYPE_TIMESTAMPTZ, catalog_access_info::dir_oid, er_clear(), ER_ERROR_SEVERITY, ER_FAILED, ER_INTERRUPTED, er_set(), ER_UPDATE_STAT_CANNOT_GET_LOCK, err, db_data::f, file_get_num_user_pages(), disk_representation::fixed, free_and_init, btree_stats::has_function, heap_estimate_num_objects(), heap_get_class_name(), btree_stats::height, HFID_IS_NULL, i, db_data::i, disk_attribute::id, btree_stats::key_type, btree_stats::keys, btree_stats::leafs, LK_GRANTED, LK_UNCOND_LOCK, lock_object(), lock_unlock_object(), db_data::money, disk_attribute::n_btstats, disk_representation::n_fixed, disk_representation::n_variable, NO_ERROR, NULL, oid_Root_class_oid, OR_BTID_ALIGNED_SIZE, OR_INT_SIZE, or_pack_domain(), or_packed_domain_size(), OR_PUT_BTID, OR_PUT_INT, btree_stats::pages, btree_stats::pkeys, btree_stats::pkeys_size, prm_get_bool_value(), PRM_ID_USE_STAT_ESTIMATION, S_LOCK, SCH_S_LOCK, tp_domain::setdomain, db_data::sh, db_datetime::time, db_data::time, db_timestamptz::timestamp, db_data::timestamptz, tp_domain_size(), TP_DOMAIN_TYPE, disk_attribute::type, db_data::utime, disk_representation::variable, hfid::vfid, btid::vfid, VFID_ISNULL, and xbtree_get_unique_pk().

Referenced by sqst_server_get_statistics(), and stats_get_statistics_from_server().

Here is the caller graph for this function:

int xstats_update_statistics ( THREAD_ENTRY thread_p,
OID class_id_p,
bool  with_fullscan 
)

Definition at line 105 of file statistics_sr.c.

References ARG_FILE_LINE, assert, ASSERT_ERROR_AND_SET, assert_release, disk_attribute::bt_stats, btree_stats::btid, BTID_IS_NULL, btree_get_stats(), BTREE_STATS_PKEYS_NUM, CATALOG_ACCESS_INFO_INITIALIZER, catalog_add_class_info(), catalog_add_representation(), catalog_end_access_with_dir_oid(), catalog_free_class_info_and_init, catalog_free_representation_and_init, catalog_get_class_info(), catalog_get_dir_oid_from_cache(), catalog_get_last_representation_id(), catalog_get_representation(), catalog_start_access_with_dir_oid(), cls_info::ci_hfid, cls_info::ci_rep_dir, cls_info::ci_time_stamp, cls_info::ci_tot_objects, cls_info::ci_tot_pages, catalog_access_info::class_name, catalog_access_info::class_oid, cubregex::count(), db_private_free, catalog_access_info::dir_oid, er_errid(), ER_FAILED, ER_LOG_FINISHED_TO_UPDATE_STATISTICS, ER_LOG_STARTED_TO_UPDATE_STATISTICS, ER_NOTIFICATION_SEVERITY, er_set(), ER_UPDATE_STAT_CANNOT_GET_LOCK, error(), file_get_num_user_pages(), vfid::fileid, disk_representation::fixed, free_and_init, heap_estimate_num_objects(), heap_get_class_name(), i, btree_stats::keys, LK_COND_LOCK, LK_GRANTED, lock_object(), lock_unlock_object(), disk_representation::n_fixed, disk_representation::n_variable, NO_ERROR, NULL, OID_ISNULL, oid_Root_class_oid, OID_SET_NULL, db_identifier::pageid, partition_get_partition_oids(), btree_stats::pkeys_size, S_LOCK, SCH_S_LOCK, db_identifier::slotid, stats_get_time_stamp(), stats_update_partitioned_statistics(), disk_representation::variable, hfid::vfid, vfid::volid, db_identifier::volid, and X_LOCK.

Referenced by sqst_update_statistics(), stats_update_partitioned_statistics(), stats_update_statistics(), cubload::session::update_class_statistics(), and xstats_update_all_statistics().

Here is the caller graph for this function: