Skip to content

File histogram_cl.cpp

FileList > cubrid > src > optimizer > histogram > histogram_cl.cpp

Go to the source code of this file

  • #include "dbtype_def.h"
  • #include "histogram_cl.hpp"
  • #include "db.h"
  • #include "histogram_builder.hpp"
  • #include "thread_compat.hpp"
  • #include "db_query.h"
  • #include "locator_cl.h"
  • #include "schema_manager.h"
  • #include "schema_system_catalog_constants.h"
  • #include <stdio.h>
  • #include <stdbool.h>
  • #include <string>
  • #include "parser.h"
  • #include "class_object.h"
  • #include "object_accessor.h"
  • #include "authenticate.h"
  • #include "query_planner.h"

Public Functions

Type Name
int analyze_classes (THREAD_ENTRY * thread_p, const char * tbl_name, const char * attr_name, int max_number_of_buckets, bool with_fullscan, MOP classop)
int db_get_histogram (MOP classop, const char * attr_name, DB_OBJECT ** histogram_obj)
int dump_histogram (MOP classop, const char * attr_name, DB_TYPE attr_type, bool with_fullscan, bool detailed, int error, FILE * f)
int get_histogram (THREAD_ENTRY * thread_p, const char * tbl_name, const char * attr_name, int max_number_of_buckets, bool with_fullscan, char ** histogram_blob, int * histogram_total_length)
int get_null_frequency (THREAD_ENTRY * thread_p, const char * tbl_name, const char * attr_name, bool with_fullscan, MOP classop)
void histogram_get_comp_selectivity (PT_NODE * lhs, DB_VALUE * rhs_db_value, bool is_ge, bool include_equal, double * selectivity, bool * success)
void histogram_get_equal_selectivity (PT_NODE * lhs, DB_VALUE * rhs_db_value, double * selectivity, bool * success)
void histogram_get_like_selectivity (PT_NODE * lhs, DB_VALUE * rhs_db_value, double * selectivity, bool * success)
bool is_histogrammable_type (DB_TYPE type)
double numeric_domain_frac_dbl_lt (double lo, double hi, double v)
double numeric_domain_frac_u64_lt (std::uint64_t lo, std::uint64_t hi, std::uint64_t v)
int set_histogram (THREAD_ENTRY * thread_p, const char * tbl_name, const char * attr_name, char * histogram_blob, int histogram_total_length, MOP classop)
int stats_free_histogram_and_init (HIST_STATS * histogram)
int stats_get_histogram (MOP classop, HIST_STATS ** histogram)

Public Static Functions

Type Name
double clamp01 (double x)
bool histogram_extract_key (const DB_VALUE * db_val, hist::histogram_key & key)
bool histogram_init_reader_from_lhs (PT_NODE * lhs, hist::HistogramReader & reader)
bool like_match_string (const std::string & pattern, const std::string & value)
double numeric_domain_frac_i64_lt (std::int64_t lo, std::int64_t hi, std::int64_t v)
double pattern_heuristic_selectivity (const std::string & pattern, char escape_char)
double string_domain_frac_lt (const std::string & lo, const std::string & hi, const std::string & v)
double string_pos (const unsigned char * s, std::size_t len, std::size_t max_len=16)

Macros

Type Name
define HIST_DUMP_WIDTH 47 /\* inner width [**of**](broker__monitor_8c.md#function-timeout) [**the**](broker__monitor_8c.md#function-timeout) histogram \*/

Public Functions Documentation

function analyze_classes

int analyze_classes (
    THREAD_ENTRY * thread_p,
    const  char * tbl_name,
    const  char * attr_name,
    int max_number_of_buckets,
    bool with_fullscan,
    MOP classop
) 

function db_get_histogram

int db_get_histogram (
    MOP classop,
    const  char * attr_name,
    DB_OBJECT ** histogram_obj
) 

function dump_histogram

int dump_histogram (
    MOP classop,
    const  char * attr_name,
    DB_TYPE attr_type,
    bool with_fullscan,
    bool detailed,
    int error,
    FILE * f
) 

function get_histogram

int get_histogram (
    THREAD_ENTRY * thread_p,
    const  char * tbl_name,
    const  char * attr_name,
    int max_number_of_buckets,
    bool with_fullscan,
    char ** histogram_blob,
    int * histogram_total_length
) 

function get_null_frequency

int get_null_frequency (
    THREAD_ENTRY * thread_p,
    const  char * tbl_name,
    const  char * attr_name,
    bool with_fullscan,
    MOP classop
) 

function histogram_get_comp_selectivity

void histogram_get_comp_selectivity (
    PT_NODE * lhs,
    DB_VALUE * rhs_db_value,
    bool is_ge,
    bool include_equal,
    double * selectivity,
    bool * success
) 

function histogram_get_equal_selectivity

void histogram_get_equal_selectivity (
    PT_NODE * lhs,
    DB_VALUE * rhs_db_value,
    double * selectivity,
    bool * success
) 

function histogram_get_like_selectivity

void histogram_get_like_selectivity (
    PT_NODE * lhs,
    DB_VALUE * rhs_db_value,
    double * selectivity,
    bool * success
) 

function is_histogrammable_type

bool is_histogrammable_type (
    DB_TYPE type
) 

function numeric_domain_frac_dbl_lt

double numeric_domain_frac_dbl_lt (
    double lo,
    double hi,
    double v
) 

function numeric_domain_frac_u64_lt

double numeric_domain_frac_u64_lt (
    std::uint64_t lo,
    std::uint64_t hi,
    std::uint64_t v
) 

function set_histogram

int set_histogram (
    THREAD_ENTRY * thread_p,
    const  char * tbl_name,
    const  char * attr_name,
    char * histogram_blob,
    int histogram_total_length,
    MOP classop
) 

function stats_free_histogram_and_init

int stats_free_histogram_and_init (
    HIST_STATS * histogram
) 

function stats_get_histogram

int stats_get_histogram (
    MOP classop,
    HIST_STATS ** histogram
) 

Public Static Functions Documentation

function clamp01

static double clamp01 (
    double x
) 

function histogram_extract_key

static bool histogram_extract_key (
    const  DB_VALUE * db_val,
    hist::histogram_key & key
) 

function histogram_init_reader_from_lhs

static bool histogram_init_reader_from_lhs (
    PT_NODE * lhs,
    hist::HistogramReader & reader
) 

function like_match_string

static bool like_match_string (
    const std::string & pattern,
    const std::string & value
) 

function numeric_domain_frac_i64_lt

static double numeric_domain_frac_i64_lt (
    std::int64_t lo,
    std::int64_t hi,
    std::int64_t v
) 

function pattern_heuristic_selectivity

static double pattern_heuristic_selectivity (
    const std::string & pattern,
    char escape_char
) 

function string_domain_frac_lt

static double string_domain_frac_lt (
    const std::string & lo,
    const std::string & hi,
    const std::string & v
) 

function string_pos

static double string_pos (
    const  unsigned  char * s,
    std::size_t len,
    std::size_t max_len=16
) 

Macro Definition Documentation

define HIST_DUMP_WIDTH

#define HIST_DUMP_WIDTH `47  /* inner width of  the histogram */`


The documentation for this class was generated from the following file cubrid/src/optimizer/histogram/histogram_cl.cpp