CUBRID Engine  latest
heap_file.c File Reference
#include <inttypes.h>
#include "config.h"
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include "heap_file.h"
#include "porting.h"
#include "porting_inline.hpp"
#include "record_descriptor.hpp"
#include "slotted_page.h"
#include "overflow_file.h"
#include "boot_sr.h"
#include "locator_sr.h"
#include "btree.h"
#include "btree_unique.hpp"
#include "transform.h"
#include "serial.h"
#include "object_primitive.h"
#include "object_representation.h"
#include "object_representation_sr.h"
#include "xserver_interface.h"
#include "chartype.h"
#include "query_executor.h"
#include "fetch.h"
#include "server_interface.h"
#include "elo.h"
#include "db_elo.h"
#include "string_opfunc.h"
#include "xasl.h"
#include "xasl_unpack_info.hpp"
#include "stream_to_xasl.h"
#include "query_opfunc.h"
#include "set_object.h"
#include "dbtype.h"
#include "thread_manager.hpp"
#include "db_value_printer.hpp"
#include "log_append.hpp"
#include "string_buffer.hpp"
#include "tde.h"
#include <set>

Go to the source code of this file.

Classes

struct  heap_hdr_stats
 
struct  heap_stats_entry
 
struct  heap_chain
 
struct  heap_chk_relocoid
 
struct  heap_chkall_relocoids
 
struct  heap_classrepr_entry
 
struct  heap_classrepr_lock
 
struct  heap_classrepr_hash
 
struct  heap_classrepr_LRU_list
 
struct  heap_classrepr_free_list
 
struct  heap_classrepr_cache
 
struct  heap_chnguess_entry
 
struct  heap_chnguess
 
struct  heap_stats_bestspace_cache
 
struct  heap_show_scan_ctx
 

Macros

#define __STDC_FORMAT_MACROS
 
#define pthread_mutex_init(a, b)
 
#define pthread_mutex_destroy(a)
 
#define pthread_mutex_lock(a)   0
 
#define pthread_mutex_trylock(a)   0
 
#define pthread_mutex_unlock(a)
 
#define HEAP_BESTSPACE_SYNC_THRESHOLD   (0.1f)
 
#define OR_FIXED_ATTRIBUTES_OFFSET_BY_OBJ(obj, nvars)   (OR_HEADER_SIZE(obj) + OR_VAR_TABLE_SIZE_INTERNAL(nvars, OR_GET_OFFSET_SIZE(obj)))
 
#define HEAP_GUESS_NUM_ATTRS_REFOIDS   100
 
#define HEAP_GUESS_NUM_INDEXED_ATTRS   100
 
#define HEAP_CLASSREPR_MAXCACHE   1024
 
#define HEAP_STATS_ENTRY_MHT_EST_SIZE   1000
 
#define HEAP_STATS_ENTRY_FREELIST_SIZE   1000
 
#define HEAP_DROP_FREE_SPACE   (int)(DB_PAGESIZE * 0.3)
 
#define HEAP_DEBUG_SCANCACHE_INITPATTERN   (12345)
 
#define HEAP_DEBUG_ISVALID_SCANRANGE(scan_range)   (DISK_VALID)
 
#define HEAP_IS_PAGE_OF_OID(thread_p, pgptr, oid)
 
#define MVCC_SET_DELETE_INFO(mvcc_delete_info_p, row_delete_id, satisfies_del_result)
 
#define HEAP_MVCC_SET_HEADER_MAXIMUM_SIZE(mvcc_rec_header_p)
 
#define HEAP_UPDATE_IS_MVCC_OP(is_mvcc_class, update_style)   (false)
 
#define HEAP_SCAN_ORDERED_HFID(scan)   (((scan) != NULL) ? (&(scan)->node.hfid) : (PGBUF_ORDERED_NULL_HFID))
 
#define HEAP_NUM_BEST_SPACESTATS   10
 
#define HEAP_STATS_NEXT_BEST_INDEX(i)   (((i) + 1) % HEAP_NUM_BEST_SPACESTATS)
 
#define HEAP_STATS_PREV_BEST_INDEX(i)   (((i) == 0) ? (HEAP_NUM_BEST_SPACESTATS - 1) : ((i) - 1));
 
#define HEAP_PAGE_FLAG_VACUUM_STATUS_MASK   0xC0000000
 
#define HEAP_PAGE_FLAG_VACUUM_ONCE   0x80000000
 
#define HEAP_PAGE_FLAG_VACUUM_UNKNOWN   0x40000000
 
#define HEAP_PAGE_SET_VACUUM_STATUS(chain, status)
 
#define HEAP_PAGE_GET_VACUUM_STATUS(chain)
 
#define HEAP_CHK_ADD_UNFOUND_RELOCOIDS   100
 
#define DEFAULT_REPR_INCREMENT   16
 
#define CLASSREPR_REPR_INCREMENT   10
 
#define CLASSREPR_HASH_SIZE   (heap_Classrepr_cache.num_entries * 2)
 
#define REPR_HASH(class_oid)   (OID_PSEUDO_KEY(class_oid)%CLASSREPR_HASH_SIZE)
 
#define HEAP_MAYNEED_DECACHE_GUESSED_LASTREPRS(class_oid, hfid)
 
#define HEAP_CHNGUESS_FUDGE_MININDICES   (100)
 
#define HEAP_NBITS_IN_BYTE   (8)
 
#define HEAP_NSHIFTS   (3) /* For multiplication/division by 8 */
 
#define HEAP_BITMASK   (HEAP_NBITS_IN_BYTE - 1)
 
#define HEAP_NBITS_TO_NBYTES(bit_cnt)   ((unsigned int)((bit_cnt) + HEAP_BITMASK) >> HEAP_NSHIFTS)
 
#define HEAP_NBYTES_TO_NBITS(byte_cnt)   ((unsigned int)(byte_cnt) << HEAP_NSHIFTS)
 
#define HEAP_NBYTES_CLEARED(byte_ptr, byte_cnt)   memset((byte_ptr), '\0', (byte_cnt))
 
#define HEAP_BYTEOFFSET_OFBIT(bit_num)   ((unsigned int)(bit_num) >> HEAP_NSHIFTS)
 
#define HEAP_BYTEGET(byte_ptr, bit_num)   ((unsigned char *)(byte_ptr) + HEAP_BYTEOFFSET_OFBIT(bit_num))
 
#define HEAP_BITMASK_INBYTE(bit_num)   (1 << ((unsigned int)(bit_num) & HEAP_BITMASK))
 
#define HEAP_BIT_GET(byte_ptr, bit_num)   (*HEAP_BYTEGET(byte_ptr, bit_num) & HEAP_BITMASK_INBYTE(bit_num))
 
#define HEAP_BIT_SET(byte_ptr, bit_num)
 
#define HEAP_BIT_CLEAR(byte_ptr, bit_num)
 
#define heap_hfid_table_log(thp, oidp, msg, ...)
 
#define HEAP_RV_FLAG_VACUUM_STATUS_CHANGE   0x8000
 
#define HEAP_PERF_START(thread_p, context)   PERF_UTIME_TRACKER_START (thread_p, (context)->time_track)
 
#define HEAP_PERF_TRACK_PREPARE(thread_p, context)
 
#define HEAP_PERF_TRACK_EXECUTE(thread_p, context)
 
#define HEAP_PERF_TRACK_LOGGING(thread_p, context)
 
#define heap_bestspace_log(...)   if (prm_get_bool_value (PRM_ID_DEBUG_BESTSPACE)) _er_log_debug (ARG_FILE_LINE, __VA_ARGS__)
 
#define heap_scan_pb_lock_and_fetch(...)   heap_scan_pb_lock_and_fetch_debug (__VA_ARGS__, ARG_FILE_LINE)
 
#define heap_classrepr_log_er(msg, ...)
 
#define heap_classrepr_log_stack(msg, ...)
 
#define BEST_PAGE_SEARCH_MAX_COUNT   100
 
#define HEAP_MAX_FIRSTSLOTID_LENGTH   (sizeof (HEAP_HDR_STATS))
 
#define HEAP_CHKRELOC_UNFOUND_SHORT   5
 
#define HEAP_LOG_MVCC_INSERT_MAX_REDO_CRUMBS   4
 
#define HEAP_LOG_MVCC_REDISTRIBUTE_MAX_REDO_CRUMBS   4
 

Typedefs

typedef struct heap_hdr_stats HEAP_HDR_STATS
 
typedef struct heap_stats_entry HEAP_STATS_ENTRY
 
typedef struct heap_chain HEAP_CHAIN
 
typedef struct heap_chk_relocoid HEAP_CHK_RELOCOID
 
typedef struct heap_chkall_relocoids HEAP_CHKALL_RELOCOIDS
 
typedef struct heap_classrepr_entry HEAP_CLASSREPR_ENTRY
 
typedef struct heap_classrepr_lock HEAP_CLASSREPR_LOCK
 
typedef struct heap_classrepr_hash HEAP_CLASSREPR_HASH
 
typedef struct heap_classrepr_LRU_list HEAP_CLASSREPR_LRU_LIST
 
typedef struct heap_classrepr_free_list HEAP_CLASSREPR_FREE_LIST
 
typedef struct heap_classrepr_cache HEAP_CLASSREPR_CACHE
 
typedef struct heap_chnguess_entry HEAP_CHNGUESS_ENTRY
 
typedef struct heap_chnguess HEAP_CHNGUESS
 
typedef struct heap_stats_bestspace_cache HEAP_STATS_BESTSPACE_CACHE
 
typedef struct heap_show_scan_ctx HEAP_SHOW_SCAN_CTX
 

Enumerations

enum  HEAP_FINDSPACE { HEAP_FINDSPACE_FOUND, HEAP_FINDSPACE_NOTFOUND, HEAP_FINDSPACE_ERROR }
 
enum  HEAP_DIRECTION { HEAP_DIRECTION_NONE, HEAP_DIRECTION_LEFT, HEAP_DIRECTION_RIGHT, HEAP_DIRECTION_BOTH }
 
enum  { ZONE_VOID = 1, ZONE_FREE = 2, ZONE_LRU = 3 }
 

Functions

static PAGE_PTR heap_scan_pb_lock_and_fetch_debug (THREAD_ENTRY *thread_p, const VPID *vpid_ptr, PAGE_FETCH_MODE fetch_mode, LOCK lock, HEAP_SCANCACHE *scan_cache, PGBUF_WATCHER *pg_watcher, const char *caller_file, const int caller_line)
 
static int heap_classrepr_initialize_cache (void)
 
static int heap_classrepr_finalize_cache (void)
 
static int heap_classrepr_decache_guessed_last (const OID *class_oid)
 
static int heap_classrepr_dump (THREAD_ENTRY *thread_p, FILE *fp, const OID *class_oid, const OR_CLASSREP *repr)
 
static int heap_classrepr_entry_reset (HEAP_CLASSREPR_ENTRY *cache_entry)
 
static int heap_classrepr_entry_remove_from_LRU (HEAP_CLASSREPR_ENTRY *cache_entry)
 
static HEAP_CLASSREPR_ENTRYheap_classrepr_entry_alloc (void)
 
static int heap_classrepr_entry_free (HEAP_CLASSREPR_ENTRY *cache_entry)
 
static OR_CLASSREPheap_classrepr_get_from_record (THREAD_ENTRY *thread_p, REPR_ID *last_reprid, const OID *class_oid, RECDES *class_recdes, REPR_ID reprid)
 
static int heap_stats_get_min_freespace (HEAP_HDR_STATS *heap_hdr)
 
static int heap_stats_update_internal (THREAD_ENTRY *thread_p, const HFID *hfid, VPID *lotspace_vpid, int free_space)
 
static void heap_stats_put_second_best (HEAP_HDR_STATS *heap_hdr, VPID *vpid)
 
static int heap_stats_get_second_best (HEAP_HDR_STATS *heap_hdr, VPID *vpid)
 
static HEAP_FINDSPACE heap_stats_find_page_in_bestspace (THREAD_ENTRY *thread_p, const HFID *hfid, HEAP_BESTSPACE *bestspace, int *idx_badspace, int record_length, int needed_space, HEAP_SCANCACHE *scan_cache, PGBUF_WATCHER *pg_watcher)
 
static PAGE_PTR heap_stats_find_best_page (THREAD_ENTRY *thread_p, const HFID *hfid, int needed_space, bool isnew_rec, int newrec_size, HEAP_SCANCACHE *space_cache, PGBUF_WATCHER *pg_watcher)
 
static int heap_stats_sync_bestspace (THREAD_ENTRY *thread_p, const HFID *hfid, HEAP_HDR_STATS *heap_hdr, VPID *hdr_vpid, bool scan_all, bool can_cycle)
 
static int heap_get_last_page (THREAD_ENTRY *thread_p, const HFID *hfid, HEAP_HDR_STATS *heap_hdr, HEAP_SCANCACHE *scan_cache, VPID *last_vpid, PGBUF_WATCHER *pg_watcher)
 
static int heap_vpid_init_new (THREAD_ENTRY *thread_p, PAGE_PTR page, void *args)
 
static int heap_vpid_alloc (THREAD_ENTRY *thread_p, const HFID *hfid, PAGE_PTR hdr_pgptr, HEAP_HDR_STATS *heap_hdr, HEAP_SCANCACHE *scan_cache, PGBUF_WATCHER *new_pg_watcher)
 
static VPIDheap_vpid_remove (THREAD_ENTRY *thread_p, const HFID *hfid, HEAP_HDR_STATS *heap_hdr, VPID *rm_vpid)
 
static int heap_create_internal (THREAD_ENTRY *thread_p, HFID *hfid, const OID *class_oid, const bool reuse_oid)
 
static const HFIDheap_reuse (THREAD_ENTRY *thread_p, const HFID *hfid, const OID *class_oid, const bool reuse_oid)
 
static bool heap_delete_all_page_records (THREAD_ENTRY *thread_p, const VPID *vpid, PAGE_PTR pgptr)
 
static int heap_reinitialize_page (THREAD_ENTRY *thread_p, PAGE_PTR pgptr, const bool is_header_page)
 
static OIDheap_ovf_insert (THREAD_ENTRY *thread_p, const HFID *hfid, OID *ovf_oid, RECDES *recdes)
 
static const OIDheap_ovf_update (THREAD_ENTRY *thread_p, const HFID *hfid, const OID *ovf_oid, RECDES *recdes)
 
static int heap_ovf_flush (THREAD_ENTRY *thread_p, const OID *ovf_oid)
 
static int heap_ovf_get_length (THREAD_ENTRY *thread_p, const OID *ovf_oid)
 
static SCAN_CODE heap_ovf_get (THREAD_ENTRY *thread_p, const OID *ovf_oid, RECDES *recdes, int chn, MVCC_SNAPSHOT *mvcc_snapshot)
 
static int heap_ovf_get_capacity (THREAD_ENTRY *thread_p, const OID *ovf_oid, int *ovf_len, int *ovf_num_pages, int *ovf_overhead, int *ovf_free_space)
 
static int heap_scancache_check_with_hfid (THREAD_ENTRY *thread_p, HFID *hfid, OID *class_oid, HEAP_SCANCACHE **scan_cache)
 
static int heap_scancache_start_internal (THREAD_ENTRY *thread_p, HEAP_SCANCACHE *scan_cache, const HFID *hfid, const OID *class_oid, int cache_last_fix_page, bool is_queryscan, int is_indexscan, MVCC_SNAPSHOT *mvcc_snapshot)
 
static int heap_scancache_force_modify (THREAD_ENTRY *thread_p, HEAP_SCANCACHE *scan_cache)
 
static int heap_scancache_reset_modify (THREAD_ENTRY *thread_p, HEAP_SCANCACHE *scan_cache, const HFID *hfid, const OID *class_oid)
 
static int heap_scancache_quick_start_internal (HEAP_SCANCACHE *scan_cache, const HFID *hfid)
 
static int heap_scancache_quick_end (THREAD_ENTRY *thread_p, HEAP_SCANCACHE *scan_cache)
 
static int heap_scancache_end_internal (THREAD_ENTRY *thread_p, HEAP_SCANCACHE *scan_cache, bool scan_state)
 
static SCAN_CODE heap_get_if_diff_chn (THREAD_ENTRY *thread_p, PAGE_PTR pgptr, INT16 slotid, RECDES *recdes, bool ispeeking, int chn, MVCC_SNAPSHOT *mvcc_snapshot)
 
static int heap_estimate_avg_length (THREAD_ENTRY *thread_p, const HFID *hfid, int &avg_reclen)
 
static int heap_get_capacity (THREAD_ENTRY *thread_p, const HFID *hfid, INT64 *num_recs, INT64 *num_recs_relocated, INT64 *num_recs_inovf, INT64 *num_pages, int *avg_freespace, int *avg_freespace_nolast, int *avg_reclength, int *avg_overhead)
 
static int heap_attrinfo_recache_attrepr (HEAP_CACHE_ATTRINFO *attr_info, bool islast_reset)
 
static int heap_attrinfo_recache (THREAD_ENTRY *thread_p, REPR_ID reprid, HEAP_CACHE_ATTRINFO *attr_info)
 
static int heap_attrinfo_check (const OID *inst_oid, HEAP_CACHE_ATTRINFO *attr_info)
 
static int heap_attrinfo_set_uninitialized (THREAD_ENTRY *thread_p, OID *inst_oid, RECDES *recdes, HEAP_CACHE_ATTRINFO *attr_info)
 
static int heap_attrinfo_start_refoids (THREAD_ENTRY *thread_p, OID *class_oid, HEAP_CACHE_ATTRINFO *attr_info)
 
static int heap_attrinfo_get_disksize (HEAP_CACHE_ATTRINFO *attr_info, bool is_mvcc_class, int *offset_size_ptr)
 
static int heap_attrvalue_read (RECDES *recdes, HEAP_ATTRVALUE *value, HEAP_CACHE_ATTRINFO *attr_info)
 
static int heap_midxkey_get_value (RECDES *recdes, OR_ATTRIBUTE *att, DB_VALUE *value, HEAP_CACHE_ATTRINFO *attr_info)
 
static OR_ATTRIBUTEheap_locate_attribute (ATTR_ID attrid, HEAP_CACHE_ATTRINFO *attr_info)
 
static DB_MIDXKEYheap_midxkey_key_get (RECDES *recdes, DB_MIDXKEY *midxkey, OR_INDEX *index, HEAP_CACHE_ATTRINFO *attrinfo, DB_VALUE *func_res, TP_DOMAIN *func_domain, TP_DOMAIN **key_domain)
 
static DB_MIDXKEYheap_midxkey_key_generate (THREAD_ENTRY *thread_p, RECDES *recdes, DB_MIDXKEY *midxkey, int *att_ids, HEAP_CACHE_ATTRINFO *attrinfo, DB_VALUE *func_res, int func_col_id, int func_attr_index_start, TP_DOMAIN *midxkey_domain)
 
static int heap_dump_hdr (FILE *fp, HEAP_HDR_STATS *heap_hdr)
 
static int heap_eval_function_index (THREAD_ENTRY *thread_p, FUNCTION_INDEX_INFO *func_index_info, int n_atts, int *att_ids, HEAP_CACHE_ATTRINFO *attr_info, RECDES *recdes, int btid_index, DB_VALUE *result, FUNC_PRED_UNPACK_INFO *func_pred, TP_DOMAIN **fi_domain)
 
static DISK_ISVALID heap_check_all_pages_by_heapchain (THREAD_ENTRY *thread_p, HFID *hfid, HEAP_CHKALL_RELOCOIDS *chk_objs, INT32 *num_checked)
 
static DISK_ISVALID heap_chkreloc_start (HEAP_CHKALL_RELOCOIDS *chk)
 
static DISK_ISVALID heap_chkreloc_end (HEAP_CHKALL_RELOCOIDS *chk)
 
static int heap_chkreloc_print_notfound (const void *ignore_reloc_oid, void *ent, void *xchk)
 
static DISK_ISVALID heap_chkreloc_next (THREAD_ENTRY *thread_p, HEAP_CHKALL_RELOCOIDS *chk, PAGE_PTR pgptr)
 
static int heap_chnguess_initialize (void)
 
static int heap_chnguess_realloc (void)
 
static int heap_chnguess_finalize (void)
 
static int heap_chnguess_decache (const OID *oid)
 
static int heap_chnguess_remove_entry (const void *oid_key, void *ent, void *xignore)
 
static int heap_stats_bestspace_initialize (void)
 
static int heap_stats_bestspace_finalize (void)
 
static int heap_get_spage_type (void)
 
static bool heap_is_reusable_oid (const FILE_TYPE file_type)
 
static SCAN_CODE heap_attrinfo_transform_to_disk_internal (THREAD_ENTRY *thread_p, HEAP_CACHE_ATTRINFO *attr_info, RECDES *old_recdes, record_descriptor *new_recdes, int lob_create_flag)
 
static int heap_stats_del_bestspace_by_vpid (THREAD_ENTRY *thread_p, VPID *vpid)
 
static int heap_stats_del_bestspace_by_hfid (THREAD_ENTRY *thread_p, const HFID *hfid)
 
static HEAP_STATS_ENTRYheap_stats_add_bestspace (THREAD_ENTRY *thread_p, const HFID *hfid, VPID *vpid, int freespace)
 
static int heap_stats_entry_free (THREAD_ENTRY *thread_p, void *data, void *args)
 
static int heap_get_partitions_from_subclasses (THREAD_ENTRY *thread_p, const OID *subclasses, int *parts_count, OR_PARTITION *partitions)
 
static int heap_class_get_partition_info (THREAD_ENTRY *thread_p, const OID *class_oid, OR_PARTITION *partition_info, HFID *class_hfid, REPR_ID *repr_id, int *has_partition_info)
 
static int heap_get_partition_attributes (THREAD_ENTRY *thread_p, const OID *cls_oid, ATTR_ID *type_id, ATTR_ID *values_id)
 
static int heap_get_class_subclasses (THREAD_ENTRY *thread_p, const OID *class_oid, int *count, OID **subclasses)
 
static unsigned int heap_hash_vpid (const void *key_vpid, unsigned int htsize)
 
static int heap_compare_vpid (const void *key_vpid1, const void *key_vpid2)
 
static unsigned int heap_hash_hfid (const void *key_hfid, unsigned int htsize)
 
static int heap_compare_hfid (const void *key_hfid1, const void *key_hfid2)
 
static char * heap_bestspace_to_string (char *buf, int buf_size, const HEAP_BESTSPACE *hb)
 
static int fill_string_to_buffer (char **start, char *end, const char *str)
 
static SCAN_CODE heap_get_record_info (THREAD_ENTRY *thread_p, const OID oid, RECDES *recdes, RECDES forward_recdes, PGBUF_WATCHER *page_watcher, HEAP_SCANCACHE *scan_cache, bool ispeeking, DB_VALUE **record_info)
 
static SCAN_CODE heap_next_internal (THREAD_ENTRY *thread_p, const HFID *hfid, OID *class_oid, OID *next_oid, RECDES *recdes, HEAP_SCANCACHE *scan_cache, bool ispeeking, bool reversed_direction, DB_VALUE **cache_recordinfo)
 
static SCAN_CODE heap_get_page_info (THREAD_ENTRY *thread_p, const OID *cls_oid, const HFID *hfid, const VPID *vpid, const PAGE_PTR pgptr, DB_VALUE **page_info)
 
static SCAN_CODE heap_get_bigone_content (THREAD_ENTRY *thread_p, HEAP_SCANCACHE *scan_cache, bool ispeeking, OID *forward_oid, RECDES *recdes)
 
static void heap_mvcc_log_insert (THREAD_ENTRY *thread_p, RECDES *p_recdes, LOG_DATA_ADDR *p_addr)
 
static void heap_mvcc_log_delete (THREAD_ENTRY *thread_p, LOG_DATA_ADDR *p_addr, LOG_RCVINDEX rcvindex)
 
static int heap_rv_mvcc_redo_delete_internal (THREAD_ENTRY *thread_p, PAGE_PTR page, PGSLOTID slotid, MVCCID mvccid)
 
static void heap_mvcc_log_home_change_on_delete (THREAD_ENTRY *thread_p, RECDES *old_recdes, RECDES *new_recdes, LOG_DATA_ADDR *p_addr)
 
static void heap_mvcc_log_home_no_change (THREAD_ENTRY *thread_p, LOG_DATA_ADDR *p_addr)
 
static void heap_mvcc_log_redistribute (THREAD_ENTRY *thread_p, RECDES *p_recdes, LOG_DATA_ADDR *p_addr)
 
static void heap_link_watchers (HEAP_OPERATION_CONTEXT *child, HEAP_OPERATION_CONTEXT *parent)
 
static void heap_unfix_watchers (THREAD_ENTRY *thread_p, HEAP_OPERATION_CONTEXT *context)
 
static void heap_clear_operation_context (HEAP_OPERATION_CONTEXT *context, HFID *hfid_p)
 
static int heap_mark_class_as_modified (THREAD_ENTRY *thread_p, OID *oid_p, int chn, bool decache)
 
static FILE_TYPE heap_get_file_type (THREAD_ENTRY *thread_p, HEAP_OPERATION_CONTEXT *context)
 
static int heap_is_valid_oid (THREAD_ENTRY *thread_p, OID *oid)
 
static int heap_fix_header_page (THREAD_ENTRY *thread_p, HEAP_OPERATION_CONTEXT *context)
 
static int heap_fix_forward_page (THREAD_ENTRY *thread_p, HEAP_OPERATION_CONTEXT *context, OID *forward_oid_hint)
 
static void heap_build_forwarding_recdes (RECDES *recdes_p, INT16 rec_type, OID *forward_oid)
 
static int heap_insert_adjust_recdes_header (THREAD_ENTRY *thread_p, HEAP_OPERATION_CONTEXT *context, bool is_mvcc_class)
 
static int heap_update_adjust_recdes_header (THREAD_ENTRY *thread_p, HEAP_OPERATION_CONTEXT *update_context, bool is_mvcc_class)
 
static int heap_insert_handle_multipage_record (THREAD_ENTRY *thread_p, HEAP_OPERATION_CONTEXT *context)
 
static int heap_get_insert_location_with_lock (THREAD_ENTRY *thread_p, HEAP_OPERATION_CONTEXT *context, PGBUF_WATCHER *home_hint_p)
 
static int heap_find_location_and_insert_rec_newhome (THREAD_ENTRY *thread_p, HEAP_OPERATION_CONTEXT *context)
 
static int heap_insert_newhome (THREAD_ENTRY *thread_p, HEAP_OPERATION_CONTEXT *parent_context, RECDES *recdes_p, OID *out_oid_p, PGBUF_WATCHER *newhome_pg_watcher)
 
static int heap_insert_physical (THREAD_ENTRY *thread_p, HEAP_OPERATION_CONTEXT *context)
 
static void heap_log_insert_physical (THREAD_ENTRY *thread_p, PAGE_PTR page_p, VFID *vfid_p, OID *oid_p, RECDES *recdes_p, bool is_mvcc_op, bool is_redistribute_op)
 
static void heap_delete_adjust_header (MVCC_REC_HEADER *header_p, MVCCID mvcc_id, bool need_mvcc_header_max_size)
 
static int heap_get_record_location (THREAD_ENTRY *thread_p, HEAP_OPERATION_CONTEXT *context)
 
static int heap_delete_bigone (THREAD_ENTRY *thread_p, HEAP_OPERATION_CONTEXT *context, bool is_mvcc_op)
 
static int heap_delete_relocation (THREAD_ENTRY *thread_p, HEAP_OPERATION_CONTEXT *context, bool is_mvcc_op)
 
static int heap_delete_home (THREAD_ENTRY *thread_p, HEAP_OPERATION_CONTEXT *context, bool is_mvcc_op)
 
static int heap_delete_physical (THREAD_ENTRY *thread_p, HFID *hfid_p, PAGE_PTR page_p, OID *oid_p)
 
static void heap_log_delete_physical (THREAD_ENTRY *thread_p, PAGE_PTR page_p, VFID *vfid_p, OID *oid_p, RECDES *recdes_p, bool mark_reusable, LOG_LSA *undo_lsa)
 
static int heap_update_bigone (THREAD_ENTRY *thread_p, HEAP_OPERATION_CONTEXT *context, bool is_mvcc_op)
 
static int heap_update_relocation (THREAD_ENTRY *thread_p, HEAP_OPERATION_CONTEXT *context, bool is_mvcc_op)
 
static int heap_update_home (THREAD_ENTRY *thread_p, HEAP_OPERATION_CONTEXT *context, bool is_mvcc_op)
 
static int heap_update_physical (THREAD_ENTRY *thread_p, PAGE_PTR page_p, short slot_id, RECDES *recdes_p)
 
static void heap_log_update_physical (THREAD_ENTRY *thread_p, PAGE_PTR page_p, VFID *vfid_p, OID *oid_p, RECDES *old_recdes_p, RECDES *new_recdes_p, LOG_RCVINDEX rcvindex)
 
static void * heap_hfid_table_entry_alloc (void)
 
static int heap_hfid_table_entry_free (void *unique_stat)
 
static int heap_hfid_table_entry_init (void *unique_stat)
 
static int heap_hfid_table_entry_uninit (void *entry)
 
static int heap_hfid_table_entry_key_copy (void *src, void *dest)
 
static unsigned int heap_hfid_table_entry_key_hash (void *key, int hash_table_size)
 
static int heap_hfid_table_entry_key_compare (void *k1, void *k2)
 
static int heap_hfid_cache_get (THREAD_ENTRY *thread_p, const OID *class_oid, HFID *hfid, FILE_TYPE *ftype_out, char **classname_out)
 
static int heap_get_class_info_from_record (THREAD_ENTRY *thread_p, const OID *class_oid, HFID *hfid, char **classname_out)
 
static void heap_page_update_chain_after_mvcc_op (THREAD_ENTRY *thread_p, PAGE_PTR heap_page, MVCCID mvccid)
 
static void heap_page_rv_chain_update (THREAD_ENTRY *thread_p, PAGE_PTR heap_page, MVCCID mvccid, bool vacuum_status_change)
 
static int heap_scancache_add_partition_node (THREAD_ENTRY *thread_p, HEAP_SCANCACHE *scan_cache, OID *partition_oid)
 
static SCAN_CODE heap_get_visible_version_from_log (THREAD_ENTRY *thread_p, RECDES *recdes, LOG_LSA *previous_version_lsa, HEAP_SCANCACHE *scan_cache, int has_chn)
 
static int heap_update_set_prev_version (THREAD_ENTRY *thread_p, const OID *oid, PGBUF_WATCHER *home_pg_watcher, PGBUF_WATCHER *fwd_pg_watcher, LOG_LSA *prev_version_lsa)
 
static int heap_scan_cache_allocate_recdes_data (THREAD_ENTRY *thread_p, HEAP_SCANCACHE *scan_cache_p, RECDES *recdes_p, int size)
 
static int heap_get_header_page (THREAD_ENTRY *thread_p, const HFID *hfid, VPID *header_vpid)
 
STATIC_INLINE HEAP_HDR_STATSheap_get_header_stats_ptr (THREAD_ENTRY *thread_p, PAGE_PTR page_header) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE int heap_copy_header_stats (THREAD_ENTRY *thread_p, PAGE_PTR page_header, HEAP_HDR_STATS *header_stats) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE HEAP_CHAINheap_get_chain_ptr (THREAD_ENTRY *thread_p, PAGE_PTR page_heap) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE int heap_copy_chain (THREAD_ENTRY *thread_p, PAGE_PTR page_heap, HEAP_CHAIN *chain) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE int heap_get_last_vpid (THREAD_ENTRY *thread_p, const HFID *hfid, VPID *last_vpid) __attribute__((ALWAYS_INLINE))
 
static void heap_scancache_block_allocate (cubmem::block &b, size_t size)
 
static void heap_scancache_block_deallocate (cubmem::block &b)
 
static int heap_get_page_with_watcher (THREAD_ENTRY *thread_p, const VPID *page_vpid, PGBUF_WATCHER *pg_watcher)
 
static int heap_add_chain_links (THREAD_ENTRY *thread_p, const HFID *hfid, const VPID *vpid, const VPID *next_link, const VPID *prev_link, PGBUF_WATCHER *page_watcher, bool keep_page_fixed, bool is_page_watcher_inited)
 
static int heap_update_and_log_header (THREAD_ENTRY *thread_p, const HFID *hfid, const PGBUF_WATCHER heap_header_watcher, HEAP_HDR_STATS *heap_hdr, const VPID new_next_vpid, const VPID new_last_vpid, const int new_num_pages)
 
bool heap_is_big_length (int length)
 
template<typename ErF , typename... Args>
void heap_classrepr_logging_template (const char *filename, const int line, ErF &&er_f, const char *msg, Args &&...args)
 
int heap_classrepr_decache (THREAD_ENTRY *thread_p, const OID *class_oid)
 
int heap_classrepr_restart_cache (void)
 
int heap_classrepr_free (OR_CLASSREP *classrep, int *idx_incache)
 
OR_CLASSREPheap_classrepr_get (THREAD_ENTRY *thread_p, const OID *class_oid, RECDES *class_recdes, REPR_ID reprid, int *idx_incache)
 
void heap_stats_update (THREAD_ENTRY *thread_p, PAGE_PTR pgptr, const HFID *hfid, int prev_freespace)
 
bool heap_remove_page_on_vacuum (THREAD_ENTRY *thread_p, PAGE_PTR *page_ptr, HFID *hfid)
 
int heap_vpid_next (THREAD_ENTRY *thread_p, const HFID *hfid, PAGE_PTR pgptr, VPID *next_vpid)
 
int heap_vpid_prev (THREAD_ENTRY *thread_p, const HFID *hfid, PAGE_PTR pgptr, VPID *prev_vpid)
 
int heap_manager_initialize (void)
 
int heap_manager_finalize (void)
 
int xheap_create (THREAD_ENTRY *thread_p, HFID *hfid, const OID *class_oid, bool reuse_oid)
 
int xheap_destroy (THREAD_ENTRY *thread_p, const HFID *hfid, const OID *class_oid)
 
int xheap_destroy_newly_created (THREAD_ENTRY *thread_p, const HFID *hfid, const OID *class_oid)
 
int heap_rv_mark_deleted_on_undo (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
int heap_rv_mark_deleted_on_postpone (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
int heap_assign_address (THREAD_ENTRY *thread_p, const HFID *hfid, OID *class_oid, OID *oid, int expected_length)
 
void heap_flush (THREAD_ENTRY *thread_p, const OID *oid)
 
int xheap_reclaim_addresses (THREAD_ENTRY *thread_p, const HFID *hfid)
 
VFIDheap_ovf_find_vfid (THREAD_ENTRY *thread_p, const HFID *hfid, VFID *ovf_vfid, bool docreate, PGBUF_LATCH_CONDITION latch_cond)
 
const OIDheap_ovf_delete (THREAD_ENTRY *thread_p, const HFID *hfid, const OID *ovf_oid, VFID *ovf_vfid_p)
 
int heap_scancache_start (THREAD_ENTRY *thread_p, HEAP_SCANCACHE *scan_cache, const HFID *hfid, const OID *class_oid, int cache_last_fix_page, int is_indexscan, MVCC_SNAPSHOT *mvcc_snapshot)
 
int heap_scancache_start_modify (THREAD_ENTRY *thread_p, HEAP_SCANCACHE *scan_cache, const HFID *hfid, const OID *class_oid, int op_type, MVCC_SNAPSHOT *mvcc_snapshot)
 
int heap_scancache_quick_start (HEAP_SCANCACHE *scan_cache)
 
int heap_scancache_quick_start_modify (HEAP_SCANCACHE *scan_cache)
 
int heap_scancache_end (THREAD_ENTRY *thread_p, HEAP_SCANCACHE *scan_cache)
 
int heap_scancache_end_when_scan_will_resume (THREAD_ENTRY *thread_p, HEAP_SCANCACHE *scan_cache)
 
void heap_scancache_end_modify (THREAD_ENTRY *thread_p, HEAP_SCANCACHE *scan_cache)
 
SCAN_CODE heap_prepare_get_context (THREAD_ENTRY *thread_p, HEAP_GET_CONTEXT *context, bool is_heap_scan, NON_EXISTENT_HANDLING non_ex_handling_type)
 
SCAN_CODE heap_get_mvcc_header (THREAD_ENTRY *thread_p, HEAP_GET_CONTEXT *context, MVCC_REC_HEADER *mvcc_header)
 
SCAN_CODE heap_get_record_data_when_all_ready (THREAD_ENTRY *thread_p, HEAP_GET_CONTEXT *context)
 
SCAN_CODE heap_first (THREAD_ENTRY *thread_p, const HFID *hfid, OID *class_oid, OID *oid, RECDES *recdes, HEAP_SCANCACHE *scan_cache, int ispeeking)
 
SCAN_CODE heap_last (THREAD_ENTRY *thread_p, const HFID *hfid, OID *class_oid, OID *oid, RECDES *recdes, HEAP_SCANCACHE *scan_cache, int ispeeking)
 
int heap_scanrange_start (THREAD_ENTRY *thread_p, HEAP_SCANRANGE *scan_range, const HFID *hfid, const OID *class_oid, MVCC_SNAPSHOT *mvcc_snapshot)
 
void heap_scanrange_end (THREAD_ENTRY *thread_p, HEAP_SCANRANGE *scan_range)
 
SCAN_CODE heap_scanrange_to_following (THREAD_ENTRY *thread_p, HEAP_SCANRANGE *scan_range, OID *start_oid)
 
SCAN_CODE heap_scanrange_to_prior (THREAD_ENTRY *thread_p, HEAP_SCANRANGE *scan_range, OID *last_oid)
 
SCAN_CODE heap_scanrange_next (THREAD_ENTRY *thread_p, OID *next_oid, RECDES *recdes, HEAP_SCANRANGE *scan_range, int ispeeking)
 
bool heap_does_exist (THREAD_ENTRY *thread_p, OID *class_oid, const OID *oid)
 
bool heap_is_object_not_null (THREAD_ENTRY *thread_p, OID *class_oid, const OID *oid)
 
int heap_get_num_objects (THREAD_ENTRY *thread_p, const HFID *hfid, int *npages, int *nobjs, int *avg_length)
 
int heap_estimate (THREAD_ENTRY *thread_p, const HFID *hfid, int *npages, int *nobjs, int *avg_length)
 
int heap_estimate_num_objects (THREAD_ENTRY *thread_p, const HFID *hfid)
 
SCAN_CODE heap_get_class_oid (THREAD_ENTRY *thread_p, const OID *oid, OID *class_oid)
 
int heap_get_class_name (THREAD_ENTRY *thread_p, const OID *class_oid, char **class_name)
 
int heap_get_class_name_alloc_if_diff (THREAD_ENTRY *thread_p, const OID *class_oid, char *guess_classname, char **classname_out)
 
int heap_attrinfo_start (THREAD_ENTRY *thread_p, const OID *class_oid, int requested_num_attrs, const ATTR_ID *attrids, HEAP_CACHE_ATTRINFO *attr_info)
 
void heap_attrinfo_end (THREAD_ENTRY *thread_p, HEAP_CACHE_ATTRINFO *attr_info)
 
int heap_attrinfo_clear_dbvalues (HEAP_CACHE_ATTRINFO *attr_info)
 
int heap_attrinfo_read_dbvalues (THREAD_ENTRY *thread_p, const OID *inst_oid, RECDES *recdes, HEAP_SCANCACHE *scan_cache, HEAP_CACHE_ATTRINFO *attr_info)
 
int heap_attrinfo_read_dbvalues_without_oid (THREAD_ENTRY *thread_p, RECDES *recdes, HEAP_CACHE_ATTRINFO *attr_info)
 
int heap_attrinfo_delete_lob (THREAD_ENTRY *thread_p, RECDES *recdes, HEAP_CACHE_ATTRINFO *attr_info)
 
void heap_attrinfo_dump (THREAD_ENTRY *thread_p, FILE *fp, HEAP_CACHE_ATTRINFO *attr_info, bool dump_schema)
 
HEAP_ATTRVALUE * heap_attrvalue_locate (ATTR_ID attrid, HEAP_CACHE_ATTRINFO *attr_info)
 
OR_ATTRIBUTEheap_locate_last_attrepr (ATTR_ID attrid, HEAP_CACHE_ATTRINFO *attr_info)
 
DB_VALUEheap_attrinfo_access (ATTR_ID attrid, HEAP_CACHE_ATTRINFO *attr_info)
 
int heap_get_class_tde_algorithm (THREAD_ENTRY *thread_p, const OID *class_oid, TDE_ALGORITHM *tde_algo)
 
int heap_get_class_partitions (THREAD_ENTRY *thread_p, const OID *class_oid, OR_PARTITION **parts, int *parts_count)
 
void heap_clear_partition_info (THREAD_ENTRY *thread_p, OR_PARTITION *parts, int parts_count)
 
int heap_get_class_supers (THREAD_ENTRY *thread_p, const OID *class_oid, OID **super_oids, int *count)
 
int heap_attrinfo_set (const OID *inst_oid, ATTR_ID attrid, DB_VALUE *attr_val, HEAP_CACHE_ATTRINFO *attr_info)
 
SCAN_CODE heap_attrinfo_transform_to_disk (THREAD_ENTRY *thread_p, HEAP_CACHE_ATTRINFO *attr_info, RECDES *old_recdes, record_descriptor *new_recdes)
 
SCAN_CODE heap_attrinfo_transform_to_disk_except_lob (THREAD_ENTRY *thread_p, HEAP_CACHE_ATTRINFO *attr_info, RECDES *old_recdes, record_descriptor *new_recdes)
 
int heap_attrinfo_start_with_index (THREAD_ENTRY *thread_p, OID *class_oid, RECDES *class_recdes, HEAP_CACHE_ATTRINFO *attr_info, HEAP_IDX_ELEMENTS_INFO *idx_info)
 
int heap_classrepr_find_index_id (OR_CLASSREP *classrepr, const BTID *btid)
 
int heap_attrinfo_start_with_btid (THREAD_ENTRY *thread_p, OID *class_oid, BTID *btid, HEAP_CACHE_ATTRINFO *attr_info)
 
DB_VALUEheap_attrinfo_generate_key (THREAD_ENTRY *thread_p, int n_atts, int *att_ids, int *atts_prefix_length, HEAP_CACHE_ATTRINFO *attr_info, RECDES *recdes, DB_VALUE *db_valuep, char *buf, FUNCTION_INDEX_INFO *func_index_info, TP_DOMAIN *midxkey_domain)
 
DB_VALUEheap_attrvalue_get_key (THREAD_ENTRY *thread_p, int btid_index, HEAP_CACHE_ATTRINFO *idx_attrinfo, RECDES *recdes, BTID *btid, DB_VALUE *db_value, char *buf, FUNC_PRED_UNPACK_INFO *func_indx_pred, TP_DOMAIN **key_domain)
 
BTIDheap_indexinfo_get_btid (int btid_index, HEAP_CACHE_ATTRINFO *attrinfo)
 
int heap_indexinfo_get_num_attrs (int btid_index, HEAP_CACHE_ATTRINFO *attrinfo)
 
int heap_indexinfo_get_attrids (int btid_index, HEAP_CACHE_ATTRINFO *attrinfo, ATTR_ID *attrids)
 
int heap_indexinfo_get_attrs_prefix_length (int btid_index, HEAP_CACHE_ATTRINFO *attrinfo, int *attrs_prefix_length, int len_attrs_prefix_length)
 
int heap_get_index_with_name (THREAD_ENTRY *thread_p, OID *class_oid, const char *index_name, BTID *btid)
 
int heap_get_indexinfo_of_btid (THREAD_ENTRY *thread_p, const OID *class_oid, const BTID *btid, BTREE_TYPE *type, int *num_attrs, ATTR_ID **attr_ids, int **attrs_prefix_length, char **btnamepp, int *func_index_col_id)
 
int heap_get_referenced_by (THREAD_ENTRY *thread_p, OID *class_oid, const OID *obj_oid, RECDES *recdes, int *max_oid_cnt, OID **oid_list)
 
int heap_prefetch (THREAD_ENTRY *thread_p, OID *class_oid, const OID *oid, LC_COPYAREA_DESC *prefetch)
 
DISK_ISVALID heap_check_all_pages (THREAD_ENTRY *thread_p, HFID *hfid)
 
DISK_ISVALID heap_check_heap_file (THREAD_ENTRY *thread_p, HFID *hfid)
 
DISK_ISVALID heap_check_all_heaps (THREAD_ENTRY *thread_p)
 
void heap_dump (THREAD_ENTRY *thread_p, FILE *fp, HFID *hfid, bool dump_records)
 
int heap_dump_capacity (THREAD_ENTRY *thread_p, FILE *fp, const HFID *hfid)
 
int heap_chnguess_get (THREAD_ENTRY *thread_p, const OID *oid, int tran_index)
 
int heap_chnguess_put (THREAD_ENTRY *thread_p, const OID *oid, int tran_index, int chn)
 
void heap_chnguess_clear (THREAD_ENTRY *thread_p, int tran_index)
 
int heap_rv_redo_newpage (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
int heap_rv_undoredo_pagehdr (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
void heap_rv_dump_statistics (FILE *fp, int ignore_length, void *data)
 
void heap_rv_dump_chain (FILE *fp, int ignore_length, void *data)
 
int heap_rv_redo_insert (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
int heap_rv_mvcc_redo_insert (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
int heap_rv_undo_insert (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
int heap_rv_redo_delete (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
int heap_rv_mvcc_undo_delete (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
int heap_rv_mvcc_undo_delete_overflow (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
int heap_rv_mvcc_redo_delete_home (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
int heap_rv_mvcc_redo_delete_overflow (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
int heap_rv_mvcc_redo_delete_newhome (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
int heap_rv_redo_mark_reusable_slot (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
int heap_rv_undo_delete (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
int heap_rv_undo_update (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
int heap_rv_redo_update (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
int heap_rv_undoredo_update (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
int heap_rv_redo_reuse_page (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
int heap_rv_redo_reuse_page_reuse_oid (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
void heap_rv_dump_reuse_page (FILE *fp, int ignore_length, void *ignore_data)
 
int xheap_get_class_num_objects_pages (THREAD_ENTRY *thread_p, const HFID *hfid, int approximation, int *nobjs, int *npages)
 
int xheap_has_instance (THREAD_ENTRY *thread_p, const HFID *hfid, OID *class_oid, int has_visible_instance)
 
REPR_ID heap_get_class_repr_id (THREAD_ENTRY *thread_p, OID *class_oid)
 
int heap_set_autoincrement_value (THREAD_ENTRY *thread_p, HEAP_CACHE_ATTRINFO *attr_info, HEAP_SCANCACHE *scan_cache, int *is_set)
 
int heap_attrinfo_set_uninitialized_global (THREAD_ENTRY *thread_p, OID *inst_oid, RECDES *recdes, HEAP_CACHE_ATTRINFO *attr_info)
 
int heap_get_class_info (THREAD_ENTRY *thread_p, const OID *class_oid, HFID *hfid_out, FILE_TYPE *ftype_out, char **classname_out)
 
int heap_compact_pages (THREAD_ENTRY *thread_p, OID *class_oid)
 
void heap_classrepr_dump_all (THREAD_ENTRY *thread_p, FILE *fp, OID *class_oid)
 
int heap_get_btid_from_index_name (THREAD_ENTRY *thread_p, const OID *p_class_oid, const char *index_name, BTID *p_found_btid)
 
int heap_object_upgrade_domain (THREAD_ENTRY *thread_p, HEAP_SCANCACHE *upd_scancache, HEAP_CACHE_ATTRINFO *attr_info, OID *oid, const ATTR_ID att_id)
 
int heap_init_func_pred_unpack_info (THREAD_ENTRY *thread_p, HEAP_CACHE_ATTRINFO *attr_info, const OID *class_oid, FUNC_PRED_UNPACK_INFO **func_indx_preds)
 
void heap_free_func_pred_unpack_info (THREAD_ENTRY *thread_p, int n_indexes, FUNC_PRED_UNPACK_INFO *func_indx_preds, int *attr_info_started)
 
int heap_header_capacity_start_scan (THREAD_ENTRY *thread_p, int show_type, DB_VALUE **arg_values, int arg_cnt, void **ptr)
 
SCAN_CODE heap_header_next_scan (THREAD_ENTRY *thread_p, int cursor, DB_VALUE **out_values, int out_cnt, void *ptr)
 
SCAN_CODE heap_capacity_next_scan (THREAD_ENTRY *thread_p, int cursor, DB_VALUE **out_values, int out_cnt, void *ptr)
 
int heap_header_capacity_end_scan (THREAD_ENTRY *thread_p, void **ptr)
 
SCAN_CODE heap_page_next (THREAD_ENTRY *thread_p, const OID *class_oid, const HFID *hfid, VPID *next_vpid, DB_VALUE **cache_pageinfo)
 
SCAN_CODE heap_page_prev (THREAD_ENTRY *thread_p, const OID *class_oid, const HFID *hfid, VPID *prev_vpid, DB_VALUE **cache_pageinfo)
 
SCAN_CODE heap_next (THREAD_ENTRY *thread_p, const HFID *hfid, OID *class_oid, OID *next_oid, RECDES *recdes, HEAP_SCANCACHE *scan_cache, int ispeeking)
 
SCAN_CODE heap_next_record_info (THREAD_ENTRY *thread_p, const HFID *hfid, OID *class_oid, OID *next_oid, RECDES *recdes, HEAP_SCANCACHE *scan_cache, int ispeeking, DB_VALUE **cache_recordinfo)
 
SCAN_CODE heap_prev (THREAD_ENTRY *thread_p, const HFID *hfid, OID *class_oid, OID *next_oid, RECDES *recdes, HEAP_SCANCACHE *scan_cache, int ispeeking)
 
SCAN_CODE heap_prev_record_info (THREAD_ENTRY *thread_p, const HFID *hfid, OID *class_oid, OID *next_oid, RECDES *recdes, HEAP_SCANCACHE *scan_cache, int ispeeking, DB_VALUE **cache_recordinfo)
 
int heap_get_mvcc_rec_header_from_overflow (PAGE_PTR ovf_page, MVCC_REC_HEADER *mvcc_header, RECDES *peek_recdes)
 
int heap_set_mvcc_rec_header_on_overflow (PAGE_PTR ovf_page, MVCC_REC_HEADER *mvcc_header)
 
int heap_get_class_oid_from_page (THREAD_ENTRY *thread_p, PAGE_PTR page_p, OID *class_oid)
 
int heap_rv_redo_update_and_update_chain (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
bool heap_attrinfo_check_unique_index (THREAD_ENTRY *thread_p, HEAP_CACHE_ATTRINFO *attr_info, ATTR_ID *att_id, int n_att_id)
 
int heap_scancache_quick_start_root_hfid (THREAD_ENTRY *thread_p, HEAP_SCANCACHE *scan_cache)
 
int heap_scancache_quick_start_with_class_oid (THREAD_ENTRY *thread_p, HEAP_SCANCACHE *scan_cache, OID *class_oid)
 
int heap_scancache_quick_start_with_class_hfid (THREAD_ENTRY *thread_p, HEAP_SCANCACHE *scan_cache, const HFID *hfid)
 
int heap_scancache_quick_start_modify_with_class_oid (THREAD_ENTRY *thread_p, HEAP_SCANCACHE *scan_cache, OID *class_oid)
 
void heap_create_insert_context (HEAP_OPERATION_CONTEXT *context, HFID *hfid_p, OID *class_oid_p, RECDES *recdes_p, HEAP_SCANCACHE *scancache_p)
 
void heap_create_delete_context (HEAP_OPERATION_CONTEXT *context, HFID *hfid_p, OID *oid_p, OID *class_oid_p, HEAP_SCANCACHE *scancache_p)
 
void heap_create_update_context (HEAP_OPERATION_CONTEXT *context, HFID *hfid_p, OID *oid_p, OID *class_oid_p, RECDES *recdes_p, HEAP_SCANCACHE *scancache_p, UPDATE_INPLACE_STYLE in_place)
 
int heap_insert_logical (THREAD_ENTRY *thread_p, HEAP_OPERATION_CONTEXT *context, PGBUF_WATCHER *home_hint_p)
 
int heap_delete_logical (THREAD_ENTRY *thread_p, HEAP_OPERATION_CONTEXT *context)
 
int heap_update_logical (THREAD_ENTRY *thread_p, HEAP_OPERATION_CONTEXT *context)
 
int heap_initialize_hfid_table (void)
 
void heap_finalize_hfid_table (void)
 
int heap_delete_hfid_from_cache (THREAD_ENTRY *thread_p, OID *class_oid)
 
int heap_vacuum_all_objects (THREAD_ENTRY *thread_p, HEAP_SCANCACHE *upd_scancache, MVCCID threshold_mvccid)
 
int heap_cache_class_info (THREAD_ENTRY *thread_p, const OID *class_oid, HFID *hfid, FILE_TYPE ftype, const char *classname_in)
 
void heap_page_set_vacuum_status_none (THREAD_ENTRY *thread_p, PAGE_PTR heap_page)
 
MVCCID heap_page_get_max_mvccid (THREAD_ENTRY *thread_p, PAGE_PTR heap_page)
 
HEAP_PAGE_VACUUM_STATUS heap_page_get_vacuum_status (THREAD_ENTRY *thread_p, PAGE_PTR heap_page)
 
int heap_rv_nop (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
int heap_rv_update_chain_after_mvcc_op (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
INT16 heap_rv_remove_flags_from_offset (INT16 offset)
 
bool heap_should_try_update_stat (const int current_freespace, const int prev_freespace)
 
int heap_rv_mvcc_redo_redistribute (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
SCAN_CODE heap_get_visible_version (THREAD_ENTRY *thread_p, const OID *oid, OID *class_oid, RECDES *recdes, HEAP_SCANCACHE *scan_cache, int ispeeking, int old_chn)
 
SCAN_CODE heap_scan_get_visible_version (THREAD_ENTRY *thread_p, const OID *oid, OID *class_oid, RECDES *recdes, HEAP_SCANCACHE *scan_cache, int ispeeking, int old_chn)
 
SCAN_CODE heap_get_visible_version_internal (THREAD_ENTRY *thread_p, HEAP_GET_CONTEXT *context, bool is_heap_scan)
 
SCAN_CODE heap_get_last_version (THREAD_ENTRY *thread_p, HEAP_GET_CONTEXT *context)
 
int heap_prepare_object_page (THREAD_ENTRY *thread_p, const OID *oid, PGBUF_WATCHER *page_watcher_p, PGBUF_LATCH_MODE latch_mode)
 
void heap_clean_get_context (THREAD_ENTRY *thread_p, HEAP_GET_CONTEXT *context)
 
void heap_init_get_context (THREAD_ENTRY *thread_p, HEAP_GET_CONTEXT *context, const OID *oid, OID *class_oid, RECDES *recdes, HEAP_SCANCACHE *scan_cache, int ispeeking, int old_chn)
 
int heap_scan_cache_allocate_area (THREAD_ENTRY *thread_p, HEAP_SCANCACHE *scan_cache_p, int size)
 
SCAN_CODE heap_get_class_record (THREAD_ENTRY *thread_p, const OID *class_oid, RECDES *recdes_p, HEAP_SCANCACHE *scan_cache, int ispeeking)
 
int heap_rv_undo_ovf_update (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
int heap_get_best_space_num_stats_entries (void)
 
int heap_get_hfid_from_vfid (THREAD_ENTRY *thread_p, const VFID *vfid, HFID *hfid)
 
bool heap_is_page_header (THREAD_ENTRY *thread_p, PAGE_PTR page)
 
int heap_alloc_new_page (THREAD_ENTRY *thread_p, HFID *hfid, OID class_oid, PGBUF_WATCHER *home_hint_p, VPID *new_page_vpid)
 
int heap_nonheader_page_capacity ()
 
int heap_rv_postpone_append_pages_to_heap (THREAD_ENTRY *thread_p, LOG_RCV *recv)
 
void heap_rv_dump_append_pages_to_heap (FILE *fp, int length, void *data)
 
void heap_log_postpone_heap_append_pages (THREAD_ENTRY *thread_p, const HFID *hfid, const OID *class_oid, const std::vector< VPID > &heap_pages_array)
 

Variables

static int rv
 
static HEAP_CLASSREPR_CACHE heap_Classrepr_cache
 
static int heap_Maxslotted_reclength
 
static int heap_Slotted_overhead = 4
 
static const int heap_Find_best_page_limit = 100
 
static HEAP_CLASSREPR_CACHEheap_Classrepr = NULL
 
static HEAP_CHNGUESS heap_Guesschn_area
 
static HEAP_CHNGUESSheap_Guesschn = NULL
 
static HEAP_STATS_BESTSPACE_CACHE heap_Bestspace_cache_area
 
static HEAP_STATS_BESTSPACE_CACHEheap_Bestspace = NULL
 
static HEAP_HFID_TABLE heap_Hfid_table_area
 
static HEAP_HFID_TABLEheap_Hfid_table = NULL
 
static const cubmem::block_allocator HEAP_SCANCACHE_BLOCK_ALLOCATOR
 

Macro Definition Documentation

#define __STDC_FORMAT_MACROS

Definition at line 26 of file heap_file.c.

#define BEST_PAGE_SEARCH_MAX_COUNT   100
#define CLASSREPR_HASH_SIZE   (heap_Classrepr_cache.num_entries * 2)

Definition at line 402 of file heap_file.c.

Referenced by heap_classrepr_initialize_cache().

#define CLASSREPR_REPR_INCREMENT   10

Definition at line 401 of file heap_file.c.

#define DEFAULT_REPR_INCREMENT   16

Definition at line 303 of file heap_file.c.

Referenced by heap_classrepr_entry_reset(), and heap_classrepr_initialize_cache().

#define heap_bestspace_log (   ...)    if (prm_get_bool_value (PRM_ID_DEBUG_BESTSPACE)) _er_log_debug (ARG_FILE_LINE, __VA_ARGS__)

Definition at line 581 of file heap_file.c.

Referenced by heap_stats_find_best_page(), and heap_stats_sync_bestspace().

#define HEAP_BESTSPACE_SYNC_THRESHOLD   (0.1f)

Definition at line 86 of file heap_file.c.

Referenced by heap_stats_find_best_page().

#define HEAP_BIT_CLEAR (   byte_ptr,
  bit_num 
)
Value:
(*HEAP_BYTEGET(byte_ptr, bit_num) = \
*HEAP_BYTEGET(byte_ptr, bit_num) & ~HEAP_BITMASK_INBYTE(bit_num))
#define HEAP_BITMASK_INBYTE(bit_num)
Definition: heap_file.c:431
#define HEAP_BYTEGET(byte_ptr, bit_num)
Definition: heap_file.c:428

Definition at line 438 of file heap_file.c.

Referenced by heap_chnguess_clear().

#define HEAP_BIT_GET (   byte_ptr,
  bit_num 
)    (*HEAP_BYTEGET(byte_ptr, bit_num) & HEAP_BITMASK_INBYTE(bit_num))

Definition at line 433 of file heap_file.c.

Referenced by heap_chnguess_get(), and heap_chnguess_remove_entry().

#define HEAP_BIT_SET (   byte_ptr,
  bit_num 
)
Value:
(*HEAP_BYTEGET(byte_ptr, bit_num) = \
*HEAP_BYTEGET(byte_ptr, bit_num) | HEAP_BITMASK_INBYTE(bit_num))
#define HEAP_BITMASK_INBYTE(bit_num)
Definition: heap_file.c:431
#define HEAP_BYTEGET(byte_ptr, bit_num)
Definition: heap_file.c:428

Definition at line 435 of file heap_file.c.

Referenced by heap_chnguess_put().

#define HEAP_BITMASK   (HEAP_NBITS_IN_BYTE - 1)

Definition at line 421 of file heap_file.c.

#define HEAP_BITMASK_INBYTE (   bit_num)    (1 << ((unsigned int)(bit_num) & HEAP_BITMASK))

Definition at line 431 of file heap_file.c.

#define HEAP_BYTEGET (   byte_ptr,
  bit_num 
)    ((unsigned char *)(byte_ptr) + HEAP_BYTEOFFSET_OFBIT(bit_num))

Definition at line 428 of file heap_file.c.

#define HEAP_BYTEOFFSET_OFBIT (   bit_num)    ((unsigned int)(bit_num) >> HEAP_NSHIFTS)

Definition at line 427 of file heap_file.c.

#define HEAP_CHK_ADD_UNFOUND_RELOCOIDS   100

Definition at line 280 of file heap_file.c.

Referenced by heap_chkreloc_next(), and heap_chkreloc_start().

#define HEAP_CHKRELOC_UNFOUND_SHORT   5

Definition at line 14540 of file heap_file.c.

Referenced by heap_chkreloc_next().

#define HEAP_CHNGUESS_FUDGE_MININDICES   (100)

Definition at line 418 of file heap_file.c.

Referenced by heap_chnguess_initialize(), and heap_chnguess_realloc().

#define heap_classrepr_log_er (   msg,
  ... 
)
Value:
void _er_log_debug(const char *file_name, const int line_no, const char *fmt,...)
void heap_classrepr_logging_template(const char *filename, const int line, ErF &&er_f, const char *msg, Args &&...args)
Definition: heap_file.c:1350
#define ARG_FILE_LINE
Definition: error_manager.h:44
bool prm_get_bool_value(PARAM_ID prm_id)

Definition at line 1358 of file heap_file.c.

Referenced by heap_classrepr_decache_guessed_last().

#define heap_classrepr_log_stack (   msg,
  ... 
)
Value:
void heap_classrepr_logging_template(const char *filename, const int line, ErF &&er_f, const char *msg, Args &&...args)
Definition: heap_file.c:1350
#define ARG_FILE_LINE
Definition: error_manager.h:44
void er_print_callstack(const char *file_name, const int line_no, const char *fmt,...)
bool prm_get_bool_value(PARAM_ID prm_id)

Definition at line 1361 of file heap_file.c.

Referenced by heap_classrepr_get().

#define HEAP_CLASSREPR_MAXCACHE   1024

Definition at line 96 of file heap_file.c.

Referenced by heap_chnguess_initialize(), and heap_classrepr_initialize_cache().

#define HEAP_DEBUG_ISVALID_SCANRANGE (   scan_range)    (DISK_VALID)
#define HEAP_GUESS_NUM_ATTRS_REFOIDS   100

Definition at line 93 of file heap_file.c.

Referenced by heap_attrinfo_start_refoids().

#define HEAP_GUESS_NUM_INDEXED_ATTRS   100

Definition at line 94 of file heap_file.c.

Referenced by heap_attrinfo_start_with_btid(), and heap_attrinfo_start_with_index().

#define heap_hfid_table_log (   thp,
  oidp,
  msg,
  ... 
)
Value:
er_print_callstack (ARG_FILE_LINE, "HEAP_INFO_CACHE[thr(%d),tran(%d,%d),OID(%d|%d|%d)]: " msg "\n", \
(thp)->index, LOG_FIND_CURRENT_TDES (thp)->tran_index, LOG_FIND_CURRENT_TDES (thp)->trid, \
OID_AS_ARGS (oidp), __VA_ARGS__)
#define OID_AS_ARGS(oidp)
Definition: oid.h:39
LOG_TDES * LOG_FIND_CURRENT_TDES(THREAD_ENTRY *thread_p=NULL)
Definition: log_impl.h:1115
#define ARG_FILE_LINE
Definition: error_manager.h:44
void er_print_callstack(const char *file_name, const int line_no, const char *fmt,...)
static HEAP_HFID_TABLE * heap_Hfid_table
Definition: heap_file.c:508

Definition at line 510 of file heap_file.c.

Referenced by heap_cache_class_info(), heap_delete_hfid_from_cache(), and heap_hfid_cache_get().

#define HEAP_IS_PAGE_OF_OID (   thread_p,
  pgptr,
  oid 
)
Value:
(((pgptr) != NULL) \
&& pgbuf_get_volume_id (pgptr) == (oid)->volid \
&& pgbuf_get_page_id (pgptr) == (oid)->pageid)
PAGEID pgbuf_get_page_id(PAGE_PTR pgptr)
Definition: page_buffer.c:4657
#define NULL
Definition: freelistheap.h:34
VOLID pgbuf_get_volume_id(PAGE_PTR pgptr)
Definition: page_buffer.c:4707

Definition at line 113 of file heap_file.c.

#define HEAP_LOG_MVCC_INSERT_MAX_REDO_CRUMBS   4

Referenced by heap_mvcc_log_insert().

#define HEAP_LOG_MVCC_REDISTRIBUTE_MAX_REDO_CRUMBS   4
#define HEAP_MAX_FIRSTSLOTID_LENGTH   (sizeof (HEAP_HDR_STATS))

Referenced by heap_manager_initialize().

#define HEAP_MAYNEED_DECACHE_GUESSED_LASTREPRS (   class_oid,
  hfid 
)
Value:
do \
{ \
{ \
} \
} \
while (0)
static HEAP_CLASSREPR_CACHE * heap_Classrepr
Definition: heap_file.c:492
int boot_find_root_heap(HFID *root_hfid_p)
Definition: boot_sr.c:325
#define NULL
Definition: freelistheap.h:34
if(extra_options)
Definition: dynamic_load.c:958
#define HFID_IS_NULL(hfid)
#define HFID_EQ(hfid_ptr1, hfid_ptr2)
Definition: heap_file.h:48
while(1)
Definition: cnvlex.c:816
static int heap_classrepr_decache_guessed_last(const OID *class_oid)
Definition: heap_file.c:1676

Definition at line 405 of file heap_file.c.

Referenced by heap_update_logical().

#define HEAP_MVCC_SET_HEADER_MAXIMUM_SIZE (   mvcc_rec_header_p)
Value:
do \
{ \
{ \
MVCC_SET_INSID (mvcc_rec_header_p, MVCCID_ALL_VISIBLE); \
} \
{ \
MVCC_SET_DELID (mvcc_rec_header_p, MVCCID_NULL); \
} \
{ \
LSA_SET_NULL(&(mvcc_rec_header_p)->prev_version_lsa); \
} \
} \
while (0)
#define OR_MVCC_FLAG_VALID_INSID
#define MVCCID_NULL
#define OR_MVCC_FLAG_VALID_DELID
#define MVCC_SET_DELID(header, mvcc_id)
Definition: mvcc.h:60
#define MVCCID_ALL_VISIBLE
#define MVCC_SET_INSID(header, mvcc_id)
Definition: mvcc.h:54
#define OR_MVCC_FLAG_VALID_PREV_VERSION
#define MVCC_IS_FLAG_SET(rec_header_p, flags)
Definition: mvcc.h:84
if(extra_options)
Definition: dynamic_load.c:958
#define MVCC_SET_FLAG_BITS(rec_header_p, flag)
Definition: mvcc.h:95
void LSA_SET_NULL(log_lsa *lsa_ptr)
Definition: log_lsa.hpp:146
while(1)
Definition: cnvlex.c:816

Definition at line 128 of file heap_file.c.

Referenced by heap_delete_adjust_header(), heap_insert_adjust_recdes_header(), and heap_update_adjust_recdes_header().

#define HEAP_NBITS_IN_BYTE   (8)

Definition at line 419 of file heap_file.c.

#define HEAP_NBITS_TO_NBYTES (   bit_cnt)    ((unsigned int)((bit_cnt) + HEAP_BITMASK) >> HEAP_NSHIFTS)

Definition at line 422 of file heap_file.c.

Referenced by heap_chnguess_initialize(), and heap_chnguess_realloc().

#define HEAP_NBYTES_CLEARED (   byte_ptr,
  byte_cnt 
)    memset((byte_ptr), '\0', (byte_cnt))

Definition at line 425 of file heap_file.c.

Referenced by heap_chnguess_initialize(), heap_chnguess_put(), and heap_chnguess_realloc().

#define HEAP_NBYTES_TO_NBITS (   byte_cnt)    ((unsigned int)(byte_cnt) << HEAP_NSHIFTS)

Definition at line 424 of file heap_file.c.

Referenced by heap_chnguess_initialize(), and heap_chnguess_realloc().

#define HEAP_NSHIFTS   (3) /* For multiplication/division by 8 */

Definition at line 420 of file heap_file.c.

#define HEAP_PAGE_FLAG_VACUUM_ONCE   0x80000000

Definition at line 241 of file heap_file.c.

#define HEAP_PAGE_FLAG_VACUUM_STATUS_MASK   0xC0000000

Definition at line 240 of file heap_file.c.

#define HEAP_PAGE_FLAG_VACUUM_UNKNOWN   0x40000000

Definition at line 242 of file heap_file.c.

#define HEAP_PAGE_SET_VACUUM_STATUS (   chain,
  status 
)
Value:
do \
{ \
|| (status) == HEAP_PAGE_VACUUM_ONCE \
|| (status) == HEAP_PAGE_VACUUM_UNKNOWN); \
if ((status) == HEAP_PAGE_VACUUM_ONCE) \
{ \
(chain)->flags |= HEAP_PAGE_FLAG_VACUUM_ONCE; \
} \
else if ((status) == HEAP_PAGE_VACUUM_UNKNOWN) \
{ \
(chain)->flags |= HEAP_PAGE_FLAG_VACUUM_UNKNOWN; \
} \
} \
while (false)
#define HEAP_PAGE_FLAG_VACUUM_UNKNOWN
Definition: heap_file.c:242
#define assert(x)
#define HEAP_PAGE_FLAG_VACUUM_ONCE
Definition: heap_file.c:241
if(extra_options)
Definition: dynamic_load.c:958
#define HEAP_PAGE_FLAG_VACUUM_STATUS_MASK
Definition: heap_file.c:240
else
while(1)
Definition: cnvlex.c:816

Definition at line 244 of file heap_file.c.

Referenced by heap_alloc_new_page(), heap_page_rv_chain_update(), heap_page_set_vacuum_status_none(), heap_page_update_chain_after_mvcc_op(), heap_reuse(), heap_rv_redo_reuse_page(), heap_rv_redo_reuse_page_reuse_oid(), and heap_vpid_alloc().

#define HEAP_PERF_START (   thread_p,
  context 
)    PERF_UTIME_TRACKER_START (thread_p, (context)->time_track)

Definition at line 519 of file heap_file.c.

Referenced by heap_delete_logical(), heap_insert_logical(), and heap_update_logical().

#define HEAP_PERF_TRACK_EXECUTE (   thread_p,
  context 
)
Value:
do \
{ \
if ((context)->time_track == NULL) break; \
switch ((context)->type) { \
PERF_UTIME_TRACKER_ADD_TIME_AND_RESTART (thread_p, \
(context)->time_track,\
break; \
PERF_UTIME_TRACKER_ADD_TIME_AND_RESTART (thread_p, (context)->time_track, PSTAT_HEAP_DELETE_EXECUTE); \
break; \
PERF_UTIME_TRACKER_ADD_TIME_AND_RESTART (thread_p, (context)->time_track, PSTAT_HEAP_UPDATE_EXECUTE); \
break; \
default: \
assert (false); \
} \
} \
while (false)
#define assert(x)
#define NULL
Definition: freelistheap.h:34
if(extra_options)
Definition: dynamic_load.c:958
while(1)
Definition: cnvlex.c:816

Definition at line 540 of file heap_file.c.

Referenced by heap_delete_bigone(), heap_delete_home(), heap_delete_relocation(), heap_insert_logical(), heap_insert_newhome(), heap_update_bigone(), heap_update_home(), and heap_update_relocation().

#define HEAP_PERF_TRACK_LOGGING (   thread_p,
  context 
)
Value:
do \
{ \
if ((context)->time_track == NULL) break; \
switch ((context)->type) { \
PERF_UTIME_TRACKER_ADD_TIME_AND_RESTART (thread_p, (context)->time_track, PSTAT_HEAP_INSERT_LOG); \
break; \
PERF_UTIME_TRACKER_ADD_TIME_AND_RESTART (thread_p, (context)->time_track, PSTAT_HEAP_DELETE_LOG); \
break; \
PERF_UTIME_TRACKER_ADD_TIME_AND_RESTART (thread_p, (context)->time_track, PSTAT_HEAP_UPDATE_LOG); \
break; \
default: \
assert (false); \
} \
} \
while (false)
#define assert(x)
#define NULL
Definition: freelistheap.h:34
if(extra_options)
Definition: dynamic_load.c:958
while(1)
Definition: cnvlex.c:816

Definition at line 561 of file heap_file.c.

Referenced by heap_delete_bigone(), heap_delete_home(), heap_delete_relocation(), heap_insert_logical(), heap_insert_newhome(), heap_update_bigone(), heap_update_home(), and heap_update_relocation().

#define HEAP_PERF_TRACK_PREPARE (   thread_p,
  context 
)
Value:
do \
{ \
if ((context)->time_track == NULL) break; \
switch ((context)->type) { \
PERF_UTIME_TRACKER_ADD_TIME_AND_RESTART (thread_p, (context)->time_track, PSTAT_HEAP_INSERT_PREPARE); \
break; \
PERF_UTIME_TRACKER_ADD_TIME_AND_RESTART (thread_p, (context)->time_track, PSTAT_HEAP_DELETE_PREPARE); \
break; \
PERF_UTIME_TRACKER_ADD_TIME_AND_RESTART (thread_p, (context)->time_track, PSTAT_HEAP_UPDATE_PREPARE); \
break; \
default: \
assert (false); \
} \
} \
while (false)
#define assert(x)
#define NULL
Definition: freelistheap.h:34
if(extra_options)
Definition: dynamic_load.c:958
while(1)
Definition: cnvlex.c:816

Definition at line 521 of file heap_file.c.

Referenced by heap_delete_logical(), heap_delete_relocation(), heap_insert_logical(), heap_update_bigone(), heap_update_home(), heap_update_logical(), and heap_update_relocation().

#define HEAP_SCAN_ORDERED_HFID (   scan)    (((scan) != NULL) ? (&(scan)->node.hfid) : (PGBUF_ORDERED_NULL_HFID))

Definition at line 156 of file heap_file.c.

#define HEAP_STATS_ENTRY_FREELIST_SIZE   1000

Definition at line 99 of file heap_file.c.

Referenced by heap_stats_entry_free().

#define HEAP_STATS_ENTRY_MHT_EST_SIZE   1000

Definition at line 98 of file heap_file.c.

Referenced by heap_stats_bestspace_initialize().

#define HEAP_STATS_NEXT_BEST_INDEX (   i)    (((i) + 1) % HEAP_NUM_BEST_SPACESTATS)
#define HEAP_STATS_PREV_BEST_INDEX (   i)    (((i) == 0) ? (HEAP_NUM_BEST_SPACESTATS - 1) : ((i) - 1));

Definition at line 187 of file heap_file.c.

Referenced by heap_stats_sync_bestspace().

#define HEAP_UPDATE_IS_MVCC_OP (   is_mvcc_class,
  update_style 
)    (false)

Definition at line 153 of file heap_file.c.

Referenced by heap_update_adjust_recdes_header(), and heap_update_logical().

#define MVCC_SET_DELETE_INFO (   mvcc_delete_info_p,
  row_delete_id,
  satisfies_del_result 
)
Value:
do \
{ \
assert ((mvcc_delete_info_p) != NULL); \
(mvcc_delete_info_p)->row_delid = (row_delete_id); \
(mvcc_delete_info_p)->satisfies_delete_result = (satisfies_del_result); \
} \
while (0)
#define assert(x)
#define NULL
Definition: freelistheap.h:34
while(1)
Definition: cnvlex.c:816

Definition at line 118 of file heap_file.c.

#define OR_FIXED_ATTRIBUTES_OFFSET_BY_OBJ (   obj,
  nvars 
)    (OR_HEADER_SIZE(obj) + OR_VAR_TABLE_SIZE_INTERNAL(nvars, OR_GET_OFFSET_SIZE(obj)))
#define pthread_mutex_destroy (   a)

Definition at line 79 of file heap_file.c.

Referenced by heap_classrepr_finalize_cache(), and heap_stats_bestspace_finalize().

#define pthread_mutex_init (   a,
 
)

Definition at line 78 of file heap_file.c.

Referenced by heap_classrepr_initialize_cache(), and heap_stats_bestspace_initialize().

#define pthread_mutex_trylock (   a)    0

Definition at line 81 of file heap_file.c.

Referenced by heap_classrepr_decache_guessed_last(), and heap_classrepr_get().

#define REPR_HASH (   class_oid)    (OID_PSEUDO_KEY(class_oid)%CLASSREPR_HASH_SIZE)

Typedef Documentation

typedef struct heap_chain HEAP_CHAIN

Definition at line 269 of file heap_file.c.

Definition at line 282 of file heap_file.c.

Definition at line 289 of file heap_file.c.

typedef struct heap_chnguess HEAP_CHNGUESS

Definition at line 454 of file heap_file.c.

Definition at line 442 of file heap_file.c.

Definition at line 364 of file heap_file.c.

Definition at line 308 of file heap_file.c.

Definition at line 356 of file heap_file.c.

Definition at line 339 of file heap_file.c.

Definition at line 331 of file heap_file.c.

Definition at line 348 of file heap_file.c.

Definition at line 190 of file heap_file.c.

Definition at line 481 of file heap_file.c.

Definition at line 468 of file heap_file.c.

Definition at line 231 of file heap_file.c.

Enumeration Type Documentation

anonymous enum
Enumerator
ZONE_VOID 
ZONE_FREE 
ZONE_LRU 

Definition at line 305 of file heap_file.c.

Enumerator
HEAP_DIRECTION_NONE 
HEAP_DIRECTION_LEFT 
HEAP_DIRECTION_RIGHT 
HEAP_DIRECTION_BOTH 

Definition at line 170 of file heap_file.c.

Enumerator
HEAP_FINDSPACE_FOUND 
HEAP_FINDSPACE_NOTFOUND 
HEAP_FINDSPACE_ERROR 

Definition at line 159 of file heap_file.c.

Function Documentation

static int fill_string_to_buffer ( char **  start,
char *  end,
const char *  str 
)
static

Definition at line 18229 of file heap_file.c.

References strlen.

Referenced by heap_header_next_scan().

Here is the caller graph for this function:

int heap_assign_address ( THREAD_ENTRY thread_p,
const HFID hfid,
OID class_oid,
OID oid,
int  expected_length 
)
static int heap_attrinfo_check ( const OID inst_oid,
HEAP_CACHE_ATTRINFO attr_info 
)
static
int heap_attrinfo_delete_lob ( THREAD_ENTRY thread_p,
RECDES recdes,
HEAP_CACHE_ATTRINFO attr_info 
)
void heap_attrinfo_dump ( THREAD_ENTRY thread_p,
FILE *  fp,
HEAP_CACHE_ATTRINFO attr_info,
bool  dump_schema 
)

Definition at line 10540 of file heap_file.c.

References db_fprint_value(), heap_classrepr_dump(), i, NO_ERROR, and pr_type_name().

Referenced by heap_dump().

Here is the caller graph for this function:

void heap_attrinfo_end ( THREAD_ENTRY thread_p,
HEAP_CACHE_ATTRINFO attr_info 
)

Definition at line 9979 of file heap_file.c.

References db_private_free_and_init, heap_attrinfo_clear_dbvalues(), heap_attrinfo_recache(), heap_classrepr_free_and_init, NO_ERROR, NULL, NULL_REPRID, and OID_SET_NULL.

Referenced by btree_sort_get_next(), catcls_get_apply_info_log_record_time(), catcls_get_db_collation(), catcls_get_server_compat_info(), css_make_access_status_exist_user(), heap_attrinfo_start(), heap_attrinfo_start_with_index(), heap_capacity_next_scan(), heap_dump(), heap_dump_capacity(), heap_eval_function_index(), heap_free_func_pred_unpack_info(), heap_get_partition_attributes(), heap_get_referenced_by(), locator_add_or_remove_index_internal(), locator_check_btree_entries(), locator_check_class(), locator_check_foreign_key(), locator_check_primary_key_delete(), locator_check_primary_key_update(), locator_check_unique_btree_entries(), locator_delete_lob_force(), locator_eval_filter_predicate(), locator_get_partition_scancache(), locator_prefetch_index_page_internal(), locator_update_index(), partition_clear_pruning_context(), process_class(), qexec_clear_access_spec_list(), qexec_clear_internal_classes(), qexec_execute_increment(), qexec_execute_insert(), qexec_execute_obj_fetch(), qexec_execute_update(), qexec_free_delete_lob_info_list(), qexec_init_next_partition(), cubload::server_class_installer::register_class_with_attributes(), scan_start_scan(), serial_load_attribute_info_of_db_serial(), serial_update_cur_val_of_serial(), cubload::server_object_loader::stop_attrinfo(), xbtree_load_index(), xbtree_load_online_index(), xlocator_check_fk_validity(), xlocator_remove_class_from_index(), xlocator_upgrade_instances_domain(), xserial_get_current_value_internal(), and xserial_get_next_value_internal().

DB_VALUE* heap_attrinfo_generate_key ( THREAD_ENTRY thread_p,
int  n_atts,
int *  att_ids,
int *  atts_prefix_length,
HEAP_CACHE_ATTRINFO attr_info,
RECDES recdes,
DB_VALUE db_valuep,
char *  buf,
FUNCTION_INDEX_INFO func_index_info,
TP_DOMAIN midxkey_domain 
)
static int heap_attrinfo_get_disksize ( HEAP_CACHE_ATTRINFO attr_info,
bool  is_mvcc_class,
int *  offset_size_ptr 
)
static
int heap_attrinfo_read_dbvalues_without_oid ( THREAD_ENTRY thread_p,
RECDES recdes,
HEAP_CACHE_ATTRINFO attr_info 
)

Definition at line 10401 of file heap_file.c.

References er_errid(), ER_FAILED, heap_attrinfo_recache(), heap_attrvalue_read(), i, NO_ERROR, NULL, and or_rep_id().

Referenced by locator_prefetch_index_page_internal().

Here is the caller graph for this function:

static int heap_attrinfo_recache_attrepr ( HEAP_CACHE_ATTRINFO attr_info,
bool  islast_reset 
)
static
int heap_attrinfo_set_uninitialized_global ( THREAD_ENTRY thread_p,
OID inst_oid,
RECDES recdes,
HEAP_CACHE_ATTRINFO attr_info 
)

Definition at line 16711 of file heap_file.c.

References ER_FAILED, heap_attrinfo_set_uninitialized(), and NULL.

int heap_attrinfo_start ( THREAD_ENTRY thread_p,
const OID class_oid,
int  requested_num_attrs,
const ATTR_ID attrids,
HEAP_CACHE_ATTRINFO attr_info 
)

Definition at line 9427 of file heap_file.c.

References assert, heap_hdr_stats::class_oid, db_private_alloc, db_private_realloc, db_value_domain_init(), er_errid(), ER_FAILED, heap_attrinfo_end(), heap_attrinfo_recache_attrepr(), heap_classrepr_get(), i, NO_ERROR, NULL, NULL_CHN, NULL_REPRID, and OID_SET_NULL.

Referenced by btree_sort_get_next(), catcls_get_apply_info_log_record_time(), catcls_get_db_collation(), catcls_get_server_compat_info(), css_make_access_status_exist_user(), heap_attrinfo_start_refoids(), heap_attrinfo_start_with_btid(), heap_capacity_next_scan(), heap_dump(), heap_dump_capacity(), heap_eval_function_index(), heap_get_partition_attributes(), heap_init_func_pred_unpack_info(), locator_check_btree_entries(), locator_check_primary_key_delete(), locator_check_primary_key_update(), locator_delete_lob_force(), locator_eval_filter_predicate(), locator_get_partition_scancache(), partition_attrinfo_get_key(), partition_find_partition_for_record(), process_class(), qexec_create_delete_lob_info(), qexec_execute_increment(), qexec_execute_insert(), qexec_execute_obj_fetch(), qexec_execute_update(), cubload::server_class_installer::register_class_with_attributes(), scan_start_scan(), serial_load_attribute_info_of_db_serial(), serial_update_cur_val_of_serial(), cubload::server_object_loader::start_attrinfo(), xbtree_load_index(), xbtree_load_online_index(), xlocator_check_fk_validity(), xlocator_upgrade_instances_domain(), xserial_get_current_value_internal(), and xserial_get_next_value_internal().

SCAN_CODE heap_attrinfo_transform_to_disk ( THREAD_ENTRY thread_p,
HEAP_CACHE_ATTRINFO attr_info,
RECDES old_recdes,
record_descriptor new_recdes 
)

Definition at line 11527 of file heap_file.c.

References heap_attrinfo_transform_to_disk_internal(), and LOB_FLAG_INCLUDE_LOB.

Referenced by locator_allocate_copy_area_by_attr_info(), and serial_update_serial_object().

Here is the caller graph for this function:

SCAN_CODE heap_attrinfo_transform_to_disk_except_lob ( THREAD_ENTRY thread_p,
HEAP_CACHE_ATTRINFO attr_info,
RECDES old_recdes,
record_descriptor new_recdes 
)

Definition at line 11547 of file heap_file.c.

References heap_attrinfo_transform_to_disk_internal(), and LOB_FLAG_EXCLUDE_LOB.

Referenced by cubload::server_object_loader::finish_line(), and locator_allocate_copy_area_by_attr_info().

Here is the caller graph for this function:

static SCAN_CODE heap_attrinfo_transform_to_disk_internal ( THREAD_ENTRY thread_p,
HEAP_CACHE_ATTRINFO attr_info,
RECDES old_recdes,
record_descriptor new_recdes,
int  lob_create_flag 
)
static
DB_VALUE* heap_attrvalue_get_key ( THREAD_ENTRY thread_p,
int  btid_index,
HEAP_CACHE_ATTRINFO idx_attrinfo,
RECDES recdes,
BTID btid,
DB_VALUE db_value,
char *  buf,
FUNC_PRED_UNPACK_INFO func_indx_pred,
TP_DOMAIN **  key_domain 
)
HEAP_ATTRVALUE* heap_attrvalue_locate ( ATTR_ID  attrid,
HEAP_CACHE_ATTRINFO attr_info 
)

Definition at line 10590 of file heap_file.c.

References i, and NULL.

Referenced by eval_key_filter(), heap_attrinfo_access(), heap_attrinfo_set(), and qexec_execute_increment().

Here is the caller graph for this function:

static char * heap_bestspace_to_string ( char *  buf,
int  buf_size,
const HEAP_BESTSPACE hb 
)
static

Definition at line 18204 of file heap_file.c.

References heap_bestspace::freespace, vpid::pageid, vpid::volid, and heap_bestspace::vpid.

Referenced by heap_header_next_scan().

Here is the caller graph for this function:

static void heap_build_forwarding_recdes ( RECDES recdes_p,
INT16  rec_type,
OID forward_oid 
)
static
static int heap_chkreloc_print_notfound ( const void *  ignore_reloc_oid,
void *  ent,
void *  xchk 
)
static
void heap_chnguess_clear ( THREAD_ENTRY thread_p,
int  tran_index 
)
static int heap_chnguess_decache ( const OID oid)
static

Definition at line 15134 of file heap_file.c.

References heap_chnguess_remove_entry(), heap_chnguess::ht, mht_get(), mht_map(), NO_ERROR, NULL, and heap_chnguess::schema_change.

Referenced by heap_classrepr_decache(), and heap_mark_class_as_modified().

Here is the caller graph for this function:

int heap_chnguess_get ( THREAD_ENTRY thread_p,
const OID oid,
int  tran_index 
)
static int heap_class_get_partition_info ( THREAD_ENTRY thread_p,
const OID class_oid,
OR_PARTITION partition_info,
HFID class_hfid,
REPR_ID repr_id,
int *  has_partition_info 
)
static
int heap_classrepr_decache ( THREAD_ENTRY thread_p,
const OID class_oid 
)
static int heap_classrepr_dump ( THREAD_ENTRY thread_p,
FILE *  fp,
const OID class_oid,
const OR_CLASSREP repr 
)
static
static int heap_classrepr_entry_remove_from_LRU ( HEAP_CLASSREPR_ENTRY cache_entry)
static
int heap_classrepr_find_index_id ( OR_CLASSREP classrepr,
const BTID btid 
)

Definition at line 12193 of file heap_file.c.

References or_index::btid, BTID_IS_EQUAL, i, or_classrep::indexes, and or_classrep::n_indexes.

Referenced by heap_attrinfo_start_with_btid(), and heap_get_indexinfo_of_btid().

Here is the caller graph for this function:

OR_CLASSREP* heap_classrepr_get ( THREAD_ENTRY thread_p,
const OID class_oid,
RECDES class_recdes,
REPR_ID  reprid,
int *  idx_incache 
)

Definition at line 2299 of file heap_file.c.

References heap_classrepr_cache::area, ARG_FILE_LINE, assert, ASSERT_ERROR, heap_hdr_stats::class_oid, heap_classrepr_entry::class_oid, ER_CSS_PTHREAD_MUTEX_LOCK, ER_CT_UNKNOWN_REPRID, ER_ERROR_SEVERITY, ER_FAILED, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), er_set_with_oserror(), heap_classrepr_entry::fcnt, heap_classrepr_entry::force_decache, free_and_init, heap_classrepr_free_list::free_cnt, heap_classrepr_cache::free_list, heap_classrepr_hash::hash_mutex, heap_classrepr_entry::hash_next, heap_classrepr_hash::hash_next, heap_classrepr_cache::hash_table, heap_classrepr_dump(), heap_classrepr_entry_alloc(), heap_classrepr_entry_free(), heap_classrepr_get_from_record(), heap_classrepr_log_stack, i, or_classrep::id, heap_classrepr_entry::idx, heap_classrepr_entry::last_reprid, heap_classrepr_entry::max_reprid, heap_classrepr_entry::mutex, NO_ERROR, NULL, NULL_REPRID, heap_classrepr_cache::num_entries, OID_AS_ARGS, OID_EQ, OLD_PAGE, or_free_classrep(), db_identifier::pageid, PGBUF_CONDITIONAL_LATCH, pgbuf_fix, PGBUF_LATCH_READ, pgbuf_unfix_and_init, pthread_mutex_lock, pthread_mutex_trylock, pthread_mutex_unlock, REC_HOME, heap_classrepr_entry::repr, REPR_HASH, rv, db_identifier::slotid, spage_get_record_type(), db_identifier::volid, and VPID_GET_FROM_OID.

Referenced by btree_check_by_class_oid(), btree_check_foreign_key(), btree_get_pkey_btid(), btree_index_next_scan(), btree_index_start_scan(), btree_is_btid_online_index(), btree_load_check_fk(), btree_repair_prev_link_by_class_oid(), catalog_get_cardinality(), heap_attrinfo_recache(), heap_attrinfo_start(), heap_attrinfo_start_refoids(), heap_attrinfo_start_with_btid(), heap_attrinfo_start_with_index(), heap_get_btid_from_index_name(), heap_get_class_repr_id(), heap_get_index_with_name(), heap_get_indexinfo_of_btid(), heap_scancache_start_modify(), heap_set_autoincrement_value(), locator_check_foreign_key(), logtb_create_unique_stats_from_repr(), logtb_tran_load_global_stats_func(), partition_get_partition_oids(), qexec_execute_build_columns(), qexec_execute_build_indexes(), stats_update_partitioned_statistics(), and xfile_apply_tde_to_class_files().

static OR_CLASSREP * heap_classrepr_get_from_record ( THREAD_ENTRY thread_p,
REPR_ID last_reprid,
const OID class_oid,
RECDES class_recdes,
REPR_ID  reprid 
)
static

Definition at line 2246 of file heap_file.c.

References heap_get_class_record(), heap_scancache_end(), heap_scancache_quick_start_root_hfid(), NULL, NULL_REPRID, or_get_classrep(), or_rep_id(), PEEK, and S_SUCCESS.

Referenced by heap_classrepr_get().

Here is the caller graph for this function:

static int heap_classrepr_initialize_cache ( void  )
static
template<typename ErF , typename... Args>
void heap_classrepr_logging_template ( const char *  filename,
const int  line,
ErF &&  er_f,
const char *  msg,
Args &&...  args 
)
int heap_classrepr_restart_cache ( void  )

Definition at line 1849 of file heap_file.c.

References assert, ER_FAILED, heap_classrepr_finalize_cache(), heap_classrepr_initialize_cache(), log_is_in_crash_recovery(), and NO_ERROR.

Referenced by log_recovery().

Here is the caller graph for this function:

void heap_clear_partition_info ( THREAD_ENTRY thread_p,
OR_PARTITION parts,
int  parts_count 
)

Definition at line 11126 of file heap_file.c.

References db_private_free, db_seq_free(), i, and NULL.

Referenced by btree_index_start_scan(), heap_header_capacity_start_scan(), partition_clear_pruning_context(), and partition_load_pruning_context().

Here is the caller graph for this function:

static int heap_compare_hfid ( const void *  key_hfid1,
const void *  key_hfid2 
)
static

Definition at line 951 of file heap_file.c.

References HFID_EQ.

Referenced by heap_stats_bestspace_initialize().

Here is the caller graph for this function:

static int heap_compare_vpid ( const void *  key_vpid1,
const void *  key_vpid2 
)
static

Definition at line 922 of file heap_file.c.

References VPID_EQ.

Referenced by heap_stats_bestspace_initialize().

Here is the caller graph for this function:

STATIC_INLINE int heap_copy_chain ( THREAD_ENTRY thread_p,
PAGE_PTR  page_heap,
HEAP_CHAIN chain 
)
STATIC_INLINE int heap_copy_header_stats ( THREAD_ENTRY thread_p,
PAGE_PTR  page_header,
HEAP_HDR_STATS header_stats 
)
void heap_create_delete_context ( HEAP_OPERATION_CONTEXT context,
HFID hfid_p,
OID oid_p,
OID class_oid_p,
HEAP_SCANCACHE scancache_p 
)
static int heap_create_internal ( THREAD_ENTRY thread_p,
HFID hfid,
const OID class_oid,
const bool  reuse_oid 
)
static

Definition at line 5161 of file heap_file.c.

References recdes::area_size, ARG_FILE_LINE, assert, ASSERT_ERROR, ASSERT_ERROR_AND_SET, assert_release, heap_hdr_stats::best, file_heap_des::class_oid, heap_hdr_stats::class_oid, recdes::data, DB_PAGESIZE, ER_ERROR_SEVERITY, ER_FAILED, ER_HEAP_UNABLE_TO_CREATE_HEAP, er_set(), error(), heap_hdr_stats::estimates, file_alloc_sticky_first_page(), file_apply_tde_algorithm(), file_create_heap(), file_descriptor_update(), FILE_HEAP, FILE_HEAP_REUSE_SLOTS, file_init_page_type(), file_tracker_reuse_heap(), vfid::fileid, fileio_get_volume_label(), FREE, heap_bestspace::freespace, heap_hdr_stats::full_search_vpid, heap_hdr_stats::head, heap_hdr_stats::head_second_best, file_descriptors::heap, heap_cache_class_info(), heap_get_class_tde_algorithm(), heap_get_spage_type(), HEAP_HEADER_AND_CHAIN_SLOTID, HEAP_MAX_ALIGN, HEAP_NUM_BEST_SPACESTATS, heap_reuse(), heap_stats_del_bestspace_by_hfid(), file_heap_des::hfid, HFID_IS_NULL, HFID_SET_NULL, hfid::hpgid, i, heap_hdr_stats::last_vpid, recdes::length, log_append_redo_data(), log_sysop_abort(), log_sysop_attach_to_outer(), log_sysop_start(), logpb_force_flush_pages(), heap_hdr_stats::next_vpid, NO_ERROR, NULL, NULL_FILEID, null_oid, NULL_PAGEID, heap_hdr_stats::num_high_best, heap_hdr_stats::num_other_high_best, heap_hdr_stats::num_pages, heap_hdr_stats::num_recs, heap_hdr_stats::num_second_best, heap_hdr_stats::num_substitutions, log_data_addr::offset, OID_INITIALIZER, heap_hdr_stats::ovf_vfid, PAGE_HEAP, vpid::pageid, PEEK, pgbuf_set_dirty(), pgbuf_set_page_ptype(), pgbuf_unfix_and_init, log_data_addr::pgptr, prm_get_bool_value(), prm_get_float_value(), PRM_ID_DONT_REUSE_HEAP_FILE, PRM_ID_HF_UNFILL_FACTOR, REC_HOME, heap_hdr_stats::recs_sumlen, RVHF_CREATE_HEADER, SAFEGUARD_RVSPACE, heap_hdr_stats::second_best, SP_SUCCESS, spage_initialize(), spage_insert(), spage_max_space_for_new_record(), heap_hdr_stats::tail_second_best, TDE_ALGORITHM_NONE, recdes::type, heap_hdr_stats::unfill_space, vacuum_log_add_dropped_file(), VACUUM_LOG_ADD_DROPPED_FILE_UNDO, log_data_addr::vfid, hfid::vfid, VFID_SET_NULL, vpid::volid, vfid::volid, heap_bestspace::vpid, and VPID_SET_NULL.

Referenced by xheap_create().

Here is the caller graph for this function:

static void heap_delete_adjust_header ( MVCC_REC_HEADER header_p,
MVCCID  mvcc_id,
bool  need_mvcc_header_max_size 
)
static

Definition at line 20449 of file heap_file.c.

References assert, HEAP_MVCC_SET_HEADER_MAXIMUM_SIZE, MVCC_SET_DELID, MVCC_SET_FLAG_BITS, NULL, and OR_MVCC_FLAG_VALID_DELID.

Referenced by heap_delete_bigone(), heap_delete_home(), and heap_delete_relocation().

Here is the caller graph for this function:

static bool heap_delete_all_page_records ( THREAD_ENTRY thread_p,
const VPID vpid,
PAGE_PTR  pgptr 
)
static
static int heap_delete_bigone ( THREAD_ENTRY thread_p,
HEAP_OPERATION_CONTEXT context,
bool  is_mvcc_op 
)
static

Definition at line 20548 of file heap_file.c.

References recdes::area_size, ARG_FILE_LINE, assert, COPY, recdes::data, DONT_FREE, er_errid(), ER_ERROR_SEVERITY, ER_FAILED, ER_LK_PAGE_TIMEOUT, ER_PAGE_LATCH_ABORTED, er_set(), heap_operation_context::file_type, heap_delete_adjust_header(), heap_delete_physical(), heap_fix_header_page(), heap_get_mvcc_rec_header_from_overflow(), heap_is_reusable_oid(), heap_log_delete_physical(), heap_mvcc_log_delete(), heap_mvcc_log_home_no_change(), HEAP_OPERATION_DELETE, heap_ovf_delete(), HEAP_PERF_TRACK_EXECUTE, HEAP_PERF_TRACK_LOGGING, heap_set_mvcc_rec_header_on_overflow(), heap_operation_context::hfid, heap_operation_context::home_page_watcher_p, heap_operation_context::home_recdes, recdes::length, logtb_get_current_mvccid(), mvcc_rec_header::mvcc_flag, mvcc_header_size_lookup, NO_ERROR, NULL, log_data_addr::offset, heap_operation_context::oid, OLD_PAGE, OR_MVCC_MAX_HEADER_SIZE, heap_operation_context::overflow_page_watcher_p, PAGE_OVERFLOW, pgbuf_watcher::page_was_unfixed, vpid::pageid, db_identifier::pageid, PEEK, perfmon_inc_stat(), pgbuf_check_page_ptype(), PGBUF_LATCH_WRITE, pgbuf_ordered_fix, PGBUF_ORDERED_HEAP_OVERFLOW, pgbuf_set_dirty(), PGBUF_WATCHER_COPY_GROUP, PGBUF_WATCHER_RESET_RANK, log_data_addr::pgptr, pgbuf_watcher::pgptr, PSTAT_HEAP_BIG_DELETES, PSTAT_HEAP_BIG_MVCC_DELETES, rc, RVHF_MVCC_DELETE_OVERFLOW, S_SUCCESS, db_identifier::slotid, spage_get_record(), heap_operation_context::type, log_data_addr::vfid, hfid::vfid, vpid::volid, and db_identifier::volid.

Referenced by heap_delete_logical().

Here is the caller graph for this function:

int heap_delete_hfid_from_cache ( THREAD_ENTRY thread_p,
OID class_oid 
)

Definition at line 23262 of file heap_file.c.

References error(), heap_hfid_table_log, heap_hfid_table::hfid_hash, lf_hash_delete(), NO_ERROR, success(), thread_get_tran_entry(), and THREAD_TS_HFID_TABLE.

Referenced by vacuum_rv_notify_dropped_file().

Here is the caller graph for this function:

static int heap_delete_home ( THREAD_ENTRY thread_p,
HEAP_OPERATION_CONTEXT context,
bool  is_mvcc_op 
)
static

Definition at line 21175 of file heap_file.c.

References recdes::area_size, assert, ASSERT_ERROR, ASSERT_ERROR_AND_SET, COPY, recdes::data, er_errid(), ER_FAILED, heap_operation_context::file_type, heap_build_forwarding_recdes(), heap_delete_adjust_header(), heap_delete_physical(), heap_insert_newhome(), heap_is_big_length(), heap_is_reusable_oid(), heap_log_delete_physical(), heap_mvcc_log_delete(), heap_mvcc_log_home_change_on_delete(), HEAP_OPERATION_DELETE, heap_ovf_insert(), HEAP_PERF_TRACK_EXECUTE, HEAP_PERF_TRACK_LOGGING, HEAP_SET_RECORD, heap_update_physical(), heap_operation_context::hfid, heap_operation_context::home_page_watcher_p, heap_operation_context::home_recdes, IO_DEFAULT_PAGE_SIZE, recdes::length, logtb_get_current_mvccid(), MAX_ALIGNMENT, mvcc_rec_header::mvcc_flag, mvcc_header_size_lookup, NO_ERROR, NULL, log_data_addr::offset, heap_operation_context::oid, OR_GET_BOUND_BIT_FLAG, OR_GET_MVCC_REPID_AND_FLAG, OR_GET_OFFSET_SIZE, or_mvcc_add_header(), OR_MVCC_DELETE_ID_OFFSET, OR_MVCC_DELETE_ID_SIZE, OR_MVCC_FLAG_MASK, OR_MVCC_FLAG_SHIFT_BITS, OR_MVCC_FLAG_VALID_DELID, OR_MVCC_FLAG_VALID_PREV_VERSION, or_mvcc_get_header(), OR_MVCC_MAX_HEADER_SIZE, OR_MVCC_PREV_VERSION_LSA_OFFSET, OR_MVCCID_SIZE, OR_PUT_BIGINT, OR_PUT_INT, pgbuf_watcher::page_was_unfixed, PEEK, perfmon_inc_stat(), log_data_addr::pgptr, pgbuf_watcher::pgptr, PSTAT_HEAP_HOME_DELETES, PSTAT_HEAP_HOME_MVCC_DELETES, PSTAT_HEAP_HOME_TO_BIG_DELETES, PSTAT_HEAP_HOME_TO_REL_DELETES, PTR_ALIGN, REC_ASSIGN_ADDRESS, REC_BIGONE, REC_HOME, REC_NEWHOME, REC_RELOCATION, REC_UNKNOWN, heap_operation_context::record_type, RVHF_MVCC_DELETE_REC_HOME, S_SUCCESS, db_identifier::slotid, spage_get_record(), spage_is_updatable(), recdes::type, heap_operation_context::type, log_data_addr::vfid, and hfid::vfid.

Referenced by heap_delete_logical().

Here is the caller graph for this function:

int heap_delete_logical ( THREAD_ENTRY thread_p,
HEAP_OPERATION_CONTEXT context 
)

Definition at line 22606 of file heap_file.c.

References recdes::area_size, ARG_FILE_LINE, assert, ASSERT_ERROR_AND_SET, heap_scancache::cache_last_fix_page, heap_operation_context::class_oid, COPY, recdes::data, DB_PAGESIZE, ER_ERROR_SEVERITY, ER_FAILED, ER_FATAL_ERROR_SEVERITY, ER_GENERIC_ERROR, ER_HEAP_BAD_OBJECT_TYPE, ER_HEAP_UNKNOWN_OBJECT, ER_INTERRUPTED, er_set(), error(), FILE_HEAP, FILE_HEAP_REUSE_SLOTS, heap_operation_context::file_type, FILE_UNKNOWN_TYPE, heap_delete_bigone(), heap_delete_home(), heap_delete_relocation(), heap_get_file_type(), heap_get_record_location(), heap_is_valid_oid(), heap_mark_class_as_modified(), HEAP_OPERATION_DELETE, HEAP_PERF_START, HEAP_PERF_TRACK_PREPARE, heap_scancache_check_with_hfid(), heap_unfix_watchers(), heap_operation_context::hfid, HFID_EQ, HFID_IS_NULL, heap_operation_context::home_page_watcher, heap_operation_context::home_page_watcher_p, heap_operation_context::home_recdes, heap_operation_context::home_recdes_buffer, MAX_ALIGNMENT, mvcc_is_mvcc_disabled_class(), NO_ERROR, NULL, NULL_CHN, heap_operation_context::oid, OID_ISNULL, heap_scancache::page_watcher, db_identifier::pageid, pgbuf_ordered_unfix, pgbuf_replace_watcher, pgbuf_watcher::pgptr, PTR_ALIGN, rc, REC_ASSIGN_ADDRESS, REC_BIGONE, REC_HOME, REC_RELOCATION, REC_UNKNOWN, heap_operation_context::record_type, heap_classrepr_cache::rootclass_hfid, S_SUCCESS, heap_operation_context::scan_cache_p, db_identifier::slotid, spage_get_record(), spage_get_record_type(), heap_operation_context::time_track, heap_operation_context::type, and db_identifier::volid.

Referenced by catcls_delete_instance(), and locator_delete_force_internal().

Here is the caller graph for this function:

static int heap_delete_physical ( THREAD_ENTRY thread_p,
HFID hfid_p,
PAGE_PTR  page_p,
OID oid_p 
)
static
static int heap_delete_relocation ( THREAD_ENTRY thread_p,
HEAP_OPERATION_CONTEXT context,
bool  is_mvcc_op 
)
static

Definition at line 20704 of file heap_file.c.

References recdes::area_size, assert, COPY, recdes::data, DONT_FREE, ER_FAILED, heap_operation_context::file_type, heap_operation_context::forward_page_watcher_p, heap_build_forwarding_recdes(), heap_delete_adjust_header(), heap_delete_physical(), heap_fix_forward_page(), heap_fix_header_page(), heap_insert_newhome(), heap_is_big_length(), heap_is_reusable_oid(), heap_log_delete_physical(), heap_mvcc_log_delete(), heap_mvcc_log_home_change_on_delete(), heap_mvcc_log_home_no_change(), HEAP_OPERATION_DELETE, heap_ovf_insert(), HEAP_PERF_TRACK_EXECUTE, HEAP_PERF_TRACK_LOGGING, HEAP_PERF_TRACK_PREPARE, HEAP_SET_RECORD, heap_update_physical(), heap_operation_context::hfid, heap_operation_context::home_page_watcher_p, heap_operation_context::home_recdes, IO_DEFAULT_PAGE_SIZE, recdes::length, log_append_postpone(), log_append_undoredo_recdes(), logtb_get_current_mvccid(), MAX_ALIGNMENT, mvcc_rec_header::mvcc_flag, mvcc_header_size_lookup, NO_ERROR, NULL, log_data_addr::offset, heap_operation_context::oid, OR_GET_BOUND_BIT_FLAG, OR_GET_MVCC_REPID_AND_FLAG, OR_GET_OFFSET_SIZE, or_mvcc_add_header(), OR_MVCC_DELETE_ID_OFFSET, OR_MVCC_FLAG_MASK, OR_MVCC_FLAG_SHIFT_BITS, OR_MVCC_FLAG_VALID_DELID, OR_MVCC_FLAG_VALID_PREV_VERSION, or_mvcc_get_header(), OR_MVCC_MAX_HEADER_SIZE, OR_MVCC_PREV_VERSION_LSA_OFFSET, OR_MVCCID_SIZE, OR_PUT_BIGINT, OR_PUT_INT, pgbuf_watcher::page_was_unfixed, PEEK, perfmon_inc_stat(), pgbuf_set_dirty(), log_data_addr::pgptr, pgbuf_watcher::pgptr, PSTAT_HEAP_REL_DELETES, PSTAT_HEAP_REL_MVCC_DELETES, PSTAT_HEAP_REL_TO_BIG_DELETES, PSTAT_HEAP_REL_TO_HOME_DELETES, PSTAT_HEAP_REL_TO_REL_DELETES, PTR_ALIGN, rc, REC_BIGONE, REC_HOME, REC_NEWHOME, REC_RELOCATION, REC_UNKNOWN, heap_operation_context::record_type, RVHF_DELETE, RVHF_MARK_REUSABLE_SLOT, RVHF_MVCC_DELETE_REC_NEWHOME, S_SUCCESS, db_identifier::slotid, spage_get_record(), spage_is_updatable(), recdes::type, heap_operation_context::type, log_data_addr::vfid, and hfid::vfid.

Referenced by heap_delete_logical().

Here is the caller graph for this function:

static int heap_estimate_avg_length ( THREAD_ENTRY thread_p,
const HFID hfid,
int &  avg_reclen 
)
static

Definition at line 9086 of file heap_file.c.

References ER_FAILED, heap_estimate(), and NO_ERROR.

Referenced by heap_assign_address().

Here is the caller graph for this function:

int heap_estimate_num_objects ( THREAD_ENTRY thread_p,
const HFID hfid 
)

Definition at line 9060 of file heap_file.c.

References ER_FAILED, and heap_estimate().

Referenced by xlocator_fetch_all(), xlocator_lock_and_fetch_all(), xstats_get_statistics_from_server(), and xstats_update_statistics().

Here is the caller graph for this function:

void heap_finalize_hfid_table ( void  )

Definition at line 23242 of file heap_file.c.

References heap_hfid_table::hfid_hash, heap_hfid_table::hfid_hash_freelist, lf_freelist_destroy(), lf_hash_destroy(), and NULL.

Referenced by heap_manager_finalize().

Here is the caller graph for this function:

SCAN_CODE heap_first ( THREAD_ENTRY thread_p,
const HFID hfid,
OID class_oid,
OID oid,
RECDES recdes,
HEAP_SCANCACHE scan_cache,
int  ispeeking 
)

Definition at line 8097 of file heap_file.c.

References heap_next(), OID_SET_NULL, hfid::vfid, vfid::volid, and db_identifier::volid.

Referenced by boot_get_db_parm(), heap_scanrange_to_following(), tde_get_keyinfo(), and xheap_has_instance().

Here is the caller graph for this function:

void heap_free_func_pred_unpack_info ( THREAD_ENTRY thread_p,
int  n_indexes,
FUNC_PRED_UNPACK_INFO func_indx_preds,
int *  attr_info_started 
)
int heap_get_best_space_num_stats_entries ( void  )

Definition at line 24829 of file heap_file.c.

References heap_stats_bestspace_cache::num_stats_entries.

Referenced by perfmon_get_peek_stats().

Here is the caller graph for this function:

SCAN_CODE heap_get_bigone_content ( THREAD_ENTRY thread_p,
HEAP_SCANCACHE scan_cache,
bool  ispeeking,
OID forward_oid,
RECDES recdes 
)
static
int heap_get_btid_from_index_name ( THREAD_ENTRY thread_p,
const OID p_class_oid,
const char *  index_name,
BTID p_found_btid 
)
static int heap_get_capacity ( THREAD_ENTRY thread_p,
const HFID hfid,
INT64 *  num_recs,
INT64 *  num_recs_relocated,
INT64 *  num_recs_inovf,
INT64 *  num_pages,
int *  avg_freespace,
int *  avg_freespace_nolast,
int *  avg_reclength,
int *  avg_overhead 
)
static
STATIC_INLINE HEAP_CHAIN * heap_get_chain_ptr ( THREAD_ENTRY thread_p,
PAGE_PTR  page_heap 
)

Definition at line 4129 of file heap_file.c.

References assert_release, recdes::data, HEAP_HEADER_AND_CHAIN_SLOTID, NULL, PEEK, S_SUCCESS, spage_get_record(), and STATIC_INLINE.

Referenced by heap_add_chain_links(), and heap_vpid_alloc().

Here is the caller graph for this function:

static int heap_get_class_info_from_record ( THREAD_ENTRY thread_p,
const OID class_oid,
HFID hfid,
char **  classname_out 
)
static
int heap_get_class_name_alloc_if_diff ( THREAD_ENTRY thread_p,
const OID class_oid,
char *  guess_classname,
char **  classname_out 
)
REPR_ID heap_get_class_repr_id ( THREAD_ENTRY thread_p,
OID class_oid 
)

Definition at line 16476 of file heap_file.c.

References heap_classrepr_free_and_init, heap_classrepr_get(), or_classrep::id, NULL, and NULL_REPRID.

Referenced by boot_compact_db(), locator_insert_force(), and locator_repl_prepare_force().

Here is the caller graph for this function:

int heap_get_class_subclasses ( THREAD_ENTRY thread_p,
const OID class_oid,
int *  count,
OID **  subclasses 
)
static
int heap_get_class_supers ( THREAD_ENTRY thread_p,
const OID class_oid,
OID **  super_oids,
int *  count 
)
int heap_get_header_page ( THREAD_ENTRY thread_p,
const HFID hfid,
VPID header_vpid 
)
static

Definition at line 19236 of file heap_file.c.

References assert, file_get_sticky_first_page(), hfid::vfid, and VFID_ISNULL.

Referenced by heap_check_heap_file(), heap_get_hfid_from_vfid(), and heap_rv_postpone_append_pages_to_heap().

Here is the caller graph for this function:

STATIC_INLINE HEAP_HDR_STATS * heap_get_header_stats_ptr ( THREAD_ENTRY thread_p,
PAGE_PTR  page_header 
)

Definition at line 4088 of file heap_file.c.

References assert_release, recdes::data, HEAP_HEADER_AND_CHAIN_SLOTID, NULL, PEEK, S_SUCCESS, spage_get_record(), and STATIC_INLINE.

Referenced by heap_get_last_vpid(), and heap_rv_postpone_append_pages_to_heap().

Here is the caller graph for this function:

int heap_get_hfid_from_vfid ( THREAD_ENTRY thread_p,
const VFID vfid,
HFID hfid 
)
static SCAN_CODE heap_get_if_diff_chn ( THREAD_ENTRY thread_p,
PAGE_PTR  pgptr,
INT16  slotid,
RECDES recdes,
bool  ispeeking,
int  chn,
MVCC_SNAPSHOT mvcc_snapshot 
)
static
int heap_get_index_with_name ( THREAD_ENTRY thread_p,
OID class_oid,
const char *  index_name,
BTID btid 
)
static int heap_get_page_with_watcher ( THREAD_ENTRY thread_p,
const VPID page_vpid,
PGBUF_WATCHER pg_watcher 
)
static

Definition at line 25311 of file heap_file.c.

References assert, ASSERT_ERROR_AND_SET, heap_scan_pb_lock_and_fetch, NO_ERROR, NULL, OLD_PAGE, pgbuf_watcher::pgptr, and X_LOCK.

Referenced by heap_add_chain_links(), and heap_rv_postpone_append_pages_to_heap().

Here is the caller graph for this function:

static int heap_get_partitions_from_subclasses ( THREAD_ENTRY thread_p,
const OID subclasses,
int *  parts_count,
OR_PARTITION partitions 
)
static

Definition at line 10946 of file heap_file.c.

References assert, cleanup(), COPY_OID, db_seq_free(), ER_FAILED, error(), heap_class_get_partition_info(), HFID_COPY, i, NO_ERROR, NULL, OID_ISNULL, and or_partition::rep_id.

Referenced by heap_get_class_partitions().

Here is the caller graph for this function:

static SCAN_CODE heap_get_record_info ( THREAD_ENTRY thread_p,
const OID  oid,
RECDES recdes,
RECDES  forward_recdes,
PGBUF_WATCHER page_watcher,
HEAP_SCANCACHE scan_cache,
bool  ispeeking,
DB_VALUE **  record_info 
)
static
int heap_get_referenced_by ( THREAD_ENTRY thread_p,
OID class_oid,
const OID obj_oid,
RECDES recdes,
int *  max_oid_cnt,
OID **  oid_list 
)
static int heap_get_spage_type ( void  )
static

Definition at line 1312 of file heap_file.c.

References ANCHORED_DONT_REUSE_SLOTS.

Referenced by heap_create_internal(), heap_reinitialize_page(), heap_rv_redo_newpage(), and heap_vpid_init_new().

Here is the caller graph for this function:

static unsigned int heap_hash_hfid ( const void *  key_hfid,
unsigned int  htsize 
)
static

Definition at line 937 of file heap_file.c.

References hfid::hpgid, hfid::vfid, and vfid::volid.

Referenced by heap_stats_bestspace_initialize().

Here is the caller graph for this function:

static unsigned int heap_hash_vpid ( const void *  key_vpid,
unsigned int  htsize 
)
static

Definition at line 908 of file heap_file.c.

References vpid::pageid, and vpid::volid.

Referenced by heap_stats_bestspace_initialize().

Here is the caller graph for this function:

int heap_header_capacity_end_scan ( THREAD_ENTRY thread_p,
void **  ptr 
)

Definition at line 18181 of file heap_file.c.

References db_private_free, heap_show_scan_ctx::hfids, NO_ERROR, and NULL.

Referenced by showstmt_scan_init().

Here is the caller graph for this function:

SCAN_CODE heap_header_next_scan ( THREAD_ENTRY thread_p,
int  cursor,
DB_VALUE **  out_values,
int  out_cnt,
void *  ptr 
)
static void * heap_hfid_table_entry_alloc ( void  )
static

Definition at line 23028 of file heap_file.c.

References heap_hfid_table_entry::classname, and NULL.

Referenced by heap_initialize_hfid_table().

Here is the caller graph for this function:

static int heap_hfid_table_entry_free ( void *  unique_stat)
static

Definition at line 23048 of file heap_file.c.

References heap_hfid_table_entry::classname, ER_FAILED, NO_ERROR, and NULL.

Referenced by heap_initialize_hfid_table().

Here is the caller graph for this function:

static int heap_hfid_table_entry_init ( void *  unique_stat)
static
static int heap_hfid_table_entry_key_compare ( void *  k1,
void *  k2 
)
static

Definition at line 23152 of file heap_file.c.

References assert, NULL, and OID_EQ.

Referenced by heap_initialize_hfid_table().

Here is the caller graph for this function:

static int heap_hfid_table_entry_key_copy ( void *  src,
void *  dest 
)
static

Definition at line 23115 of file heap_file.c.

References COPY_OID, ER_FAILED, NO_ERROR, and NULL.

Referenced by heap_initialize_hfid_table().

Here is the caller graph for this function:

static unsigned int heap_hfid_table_entry_key_hash ( void *  key,
int  hash_table_size 
)
static

Definition at line 23139 of file heap_file.c.

References OID_PSEUDO_KEY.

Referenced by heap_initialize_hfid_table().

Here is the caller graph for this function:

static int heap_hfid_table_entry_uninit ( void *  entry)
static

Definition at line 23097 of file heap_file.c.

References heap_hfid_table_entry::classname, NO_ERROR, and NULL.

Referenced by heap_initialize_hfid_table().

Here is the caller graph for this function:

int heap_indexinfo_get_attrids ( int  btid_index,
HEAP_CACHE_ATTRINFO attrinfo,
ATTR_ID attrids 
)

Definition at line 13030 of file heap_file.c.

References i, and NO_ERROR.

Referenced by locator_check_class().

Here is the caller graph for this function:

int heap_indexinfo_get_attrs_prefix_length ( int  btid_index,
HEAP_CACHE_ATTRINFO attrinfo,
int *  attrs_prefix_length,
int  len_attrs_prefix_length 
)

Definition at line 13054 of file heap_file.c.

References i, and NO_ERROR.

Referenced by locator_check_class().

Here is the caller graph for this function:

BTID* heap_indexinfo_get_btid ( int  btid_index,
HEAP_CACHE_ATTRINFO attrinfo 
)

Definition at line 12991 of file heap_file.c.

References NULL.

Referenced by locator_check_class(), and locator_prefetch_index_page().

Here is the caller graph for this function:

int heap_indexinfo_get_num_attrs ( int  btid_index,
HEAP_CACHE_ATTRINFO attrinfo 
)

Definition at line 13010 of file heap_file.c.

Referenced by locator_check_class().

Here is the caller graph for this function:

int heap_insert_logical ( THREAD_ENTRY thread_p,
HEAP_OPERATION_CONTEXT context,
PGBUF_WATCHER home_hint_p 
)

Definition at line 22426 of file heap_file.c.

References assert, BU_LOCK, heap_scancache::cache_last_fix_page, heap_operation_context::class_oid, DONT_FREE, ER_FAILED, error(), heap_get_insert_location_with_lock(), heap_insert_adjust_recdes_header(), heap_insert_handle_multipage_record(), heap_insert_physical(), heap_log_insert_physical(), heap_mark_class_as_modified(), HEAP_OPERATION_INSERT, HEAP_PERF_START, HEAP_PERF_TRACK_EXECUTE, HEAP_PERF_TRACK_LOGGING, HEAP_PERF_TRACK_PREPARE, heap_scancache_check_with_hfid(), heap_unfix_watchers(), heap_operation_context::hfid, HFID_EQ, HFID_IS_NULL, heap_operation_context::home_page_watcher, heap_operation_context::home_page_watcher_p, heap_operation_context::is_bulk_op, heap_operation_context::is_redistribute_insert_with_delid, IX_LOCK, LK_GRANTED, LK_UNCOND_LOCK, lock_has_lock_on_object(), lock_object(), mvcc_is_mvcc_disabled_class(), NO_ERROR, NULL, OID_IS_ROOTOID, OID_ISNULL, oid_Root_class_oid, or_chn(), heap_scancache::page_watcher, perfmon_inc_stat(), pgbuf_ordered_unfix, pgbuf_replace_watcher, pgbuf_set_dirty(), pgbuf_watcher::pgptr, PSTAT_HEAP_ASSIGN_INSERTS, PSTAT_HEAP_BIG_INSERTS, PSTAT_HEAP_HOME_INSERTS, rc, REC_ASSIGN_ADDRESS, REC_BIGONE, REC_HOME, heap_operation_context::recdes_p, heap_operation_context::res_oid, heap_classrepr_cache::rootclass_hfid, heap_operation_context::scan_cache_p, heap_operation_context::time_track, recdes::type, heap_operation_context::type, heap_operation_context::use_bulk_logging, and hfid::vfid.

Referenced by boot_create_all_volumes(), heap_assign_address(), locator_insert_force(), and tde_initialize().

Here is the caller graph for this function:

bool heap_is_page_header ( THREAD_ENTRY thread_p,
PAGE_PTR  page 
)

Definition at line 24869 of file heap_file.c.

References assert, HEAP_HEADER_AND_CHAIN_SLOTID, NULL, spage_header::num_records, PAGE_HEAP, pgbuf_get_page_ptype(), spage_slot::record_length, and spage_get_slot().

Referenced by pgbuf_has_perm_pages_fixed().

Here is the caller graph for this function:

static bool heap_is_reusable_oid ( const FILE_TYPE  file_type)
static
static int heap_is_valid_oid ( THREAD_ENTRY thread_p,
OID oid 
)
static
SCAN_CODE heap_last ( THREAD_ENTRY thread_p,
const HFID hfid,
OID class_oid,
OID oid,
RECDES recdes,
HEAP_SCANCACHE scan_cache,
int  ispeeking 
)
static OR_ATTRIBUTE * heap_locate_attribute ( ATTR_ID  attrid,
HEAP_CACHE_ATTRINFO attr_info 
)
static

Definition at line 10613 of file heap_file.c.

References i, and NULL.

Referenced by heap_midxkey_key_generate().

Here is the caller graph for this function:

OR_ATTRIBUTE* heap_locate_last_attrepr ( ATTR_ID  attrid,
HEAP_CACHE_ATTRINFO attr_info 
)

Definition at line 10637 of file heap_file.c.

References i, and NULL.

Referenced by qexec_execute_insert().

Here is the caller graph for this function:

static void heap_log_delete_physical ( THREAD_ENTRY thread_p,
PAGE_PTR  page_p,
VFID vfid_p,
OID oid_p,
RECDES recdes_p,
bool  mark_reusable,
LOG_LSA undo_lsa 
)
static
static void heap_log_insert_physical ( THREAD_ENTRY thread_p,
PAGE_PTR  page_p,
VFID vfid_p,
OID oid_p,
RECDES recdes_p,
bool  is_mvcc_op,
bool  is_redistribute_op 
)
static
void heap_log_postpone_heap_append_pages ( THREAD_ENTRY thread_p,
const HFID hfid,
const OID class_oid,
const std::vector< VPID > &  heap_pages_array 
)
static void heap_log_update_physical ( THREAD_ENTRY thread_p,
PAGE_PTR  page_p,
VFID vfid_p,
OID oid_p,
RECDES old_recdes_p,
RECDES new_recdes_p,
LOG_RCVINDEX  rcvindex 
)
static
int heap_manager_finalize ( void  )

Definition at line 5111 of file heap_file.c.

References heap_chnguess_finalize(), heap_classrepr_finalize_cache(), heap_finalize_hfid_table(), heap_stats_bestspace_finalize(), and NO_ERROR.

Referenced by boot_server_all_finalize().

Here is the caller graph for this function:

static void heap_mvcc_log_home_change_on_delete ( THREAD_ENTRY thread_p,
RECDES old_recdes,
RECDES new_recdes,
LOG_DATA_ADDR p_addr 
)
static
static SCAN_CODE heap_next_internal ( THREAD_ENTRY thread_p,
const HFID hfid,
OID class_oid,
OID next_oid,
RECDES recdes,
HEAP_SCANCACHE scan_cache,
bool  ispeeking,
bool  reversed_direction,
DB_VALUE **  cache_recordinfo 
)
static
SCAN_CODE heap_next_record_info ( THREAD_ENTRY thread_p,
const HFID hfid,
OID class_oid,
OID next_oid,
RECDES recdes,
HEAP_SCANCACHE scan_cache,
int  ispeeking,
DB_VALUE **  cache_recordinfo 
)

Definition at line 18648 of file heap_file.c.

References heap_next_internal().

Referenced by scan_next_heap_scan().

Here is the caller graph for this function:

int heap_nonheader_page_capacity ( )

Definition at line 25032 of file heap_file.c.

References spage_max_record_size().

Referenced by locator_multi_insert_force().

Here is the caller graph for this function:

int heap_object_upgrade_domain ( THREAD_ENTRY thread_p,
HEAP_SCANCACHE upd_scancache,
HEAP_CACHE_ATTRINFO attr_info,
OID oid,
const ATTR_ID  att_id 
)

Definition at line 17011 of file heap_file.c.

References db_monetary::amount, ARG_FILE_LINE, assert, char_isspace(), tp_domain::codeset, tp_domain::collation_id, db_get_bigint(), db_get_double(), db_get_float(), db_get_int(), db_get_monetary(), db_get_short(), db_get_string(), db_get_string_length(), db_get_string_size(), DB_IS_NULL, db_make_null(), DB_NOT_PARTITIONED_CLASS, DB_TYPE_BIGINT, DB_TYPE_CHAR, DB_TYPE_DOUBLE, DB_TYPE_ENUMERATION, DB_TYPE_FLOAT, DB_TYPE_INTEGER, DB_TYPE_MONETARY, DB_TYPE_NCHAR, DB_TYPE_NUMERIC, DB_TYPE_SMALLINT, DB_TYPE_VARCHAR, DB_TYPE_VARNCHAR, db_value_domain_default(), db_value_domain_max(), db_value_domain_min(), DB_VALUE_DOMAIN_TYPE, DOMAIN_COMPATIBLE, tp_domain::enumeration, ER_ALTER_CHANGE_CAST_FAILED_SET_DEFAULT, ER_ALTER_CHANGE_CAST_FAILED_SET_MAX, ER_ALTER_CHANGE_CAST_FAILED_SET_MIN, ER_ALTER_CHANGE_TRUNC_OVERFLOW_NOT_ALLOWED, er_clear(), ER_ERROR_SEVERITY, ER_IT_DATA_OVERFLOW, ER_MVCC_NOT_SATISFIED_REEVALUATION, ER_QPROC_SIZE_STRING_TRUNCATED, er_set(), er_stack_pop(), er_stack_push(), ER_UNEXPECTED, ER_WARNING_SEVERITY, error(), heap_scancache_node::hfid, i, INTL_CODESET_RAW_BYTES, LC_FLUSH_UPDATE, locator_attribute_info_force(), NO_ERROR, heap_scancache::node, NULL, numeric_db_value_is_positive(), p, pr_clear_value(), pr_clone_value(), tp_domain::precision, prm_get_bool_value(), PRM_ID_ALLOW_TRUNCATED_STRING, PRM_ID_ALTER_TABLE_CHANGE_TYPE_STRICT, QSTR_IS_ANY_CHAR, QSTR_IS_ANY_CHAR_OR_BIT, QSTR_IS_BIT, REPL_INFO_TYPE_RBR_NORMAL, tp_domain::scale, SINGLE_ROW_UPDATE, TP_DOMAIN_CODESET, tp_domain_resolve_default(), tp_domain_status_er_set(), TP_DOMAIN_TYPE, TP_IS_CHAR_TYPE, tp_value_cast(), and UPDATE_INPLACE_OLD_MVCCID.

Referenced by xlocator_upgrade_instances_domain().

Here is the caller graph for this function:

const OID* heap_ovf_delete ( THREAD_ENTRY thread_p,
const HFID hfid,
const OID ovf_oid,
VFID ovf_vfid_p 
)
static int heap_ovf_flush ( THREAD_ENTRY thread_p,
const OID ovf_oid 
)
static

Definition at line 6558 of file heap_file.c.

References NO_ERROR, overflow_flush(), vpid::pageid, db_identifier::pageid, vpid::volid, and db_identifier::volid.

Referenced by heap_flush().

Here is the caller graph for this function:

static SCAN_CODE heap_ovf_get ( THREAD_ENTRY thread_p,
const OID ovf_oid,
RECDES recdes,
int  chn,
MVCC_SNAPSHOT mvcc_snapshot 
)
static
static int heap_ovf_get_capacity ( THREAD_ENTRY thread_p,
const OID ovf_oid,
int *  ovf_len,
int *  ovf_num_pages,
int *  ovf_overhead,
int *  ovf_free_space 
)
static

Definition at line 6648 of file heap_file.c.

References overflow_get_capacity(), vpid::pageid, db_identifier::pageid, vpid::volid, and db_identifier::volid.

Referenced by heap_get_capacity().

Here is the caller graph for this function:

static int heap_ovf_get_length ( THREAD_ENTRY thread_p,
const OID ovf_oid 
)
static
static const OID * heap_ovf_update ( THREAD_ENTRY thread_p,
const HFID hfid,
const OID ovf_oid,
RECDES recdes 
)
static
MVCCID heap_page_get_max_mvccid ( THREAD_ENTRY thread_p,
PAGE_PTR  heap_page 
)

Definition at line 23798 of file heap_file.c.

References assert, assert_release, recdes::data, HEAP_HEADER_AND_CHAIN_SLOTID, recdes::length, heap_chain::max_mvccid, MVCCID_NULL, NULL, PEEK, S_SUCCESS, and spage_get_record().

Referenced by xheap_reclaim_addresses().

Here is the caller graph for this function:

SCAN_CODE heap_prepare_get_context ( THREAD_ENTRY thread_p,
HEAP_GET_CONTEXT context,
bool  is_heap_scan,
NON_EXISTENT_HANDLING  non_ex_handling_type 
)
SCAN_CODE heap_prev ( THREAD_ENTRY thread_p,
const HFID hfid,
OID class_oid,
OID next_oid,
RECDES recdes,
HEAP_SCANCACHE scan_cache,
int  ispeeking 
)

Definition at line 18671 of file heap_file.c.

References heap_next_internal(), and NULL.

Referenced by heap_last(), heap_scanrange_next(), heap_scanrange_to_prior(), and scan_next_heap_scan().

Here is the caller graph for this function:

SCAN_CODE heap_prev_record_info ( THREAD_ENTRY thread_p,
const HFID hfid,
OID class_oid,
OID next_oid,
RECDES recdes,
HEAP_SCANCACHE scan_cache,
int  ispeeking,
DB_VALUE **  cache_recordinfo 
)

Definition at line 18697 of file heap_file.c.

References heap_next_internal().

Referenced by scan_next_heap_scan().

Here is the caller graph for this function:

bool heap_remove_page_on_vacuum ( THREAD_ENTRY thread_p,
PAGE_PTR page_ptr,
HFID hfid 
)

Definition at line 4643 of file heap_file.c.

References recdes::area_size, assert, ASSERT_ERROR, assert_release, heap_hdr_stats::best, COPY, recdes::data, DONT_FREE, error(), heap_hdr_stats::estimates, file_dealloc(), FILE_HEAP, heap_bestspace::freespace, heap_hdr_stats::full_search_vpid, heap_hdr_stats::head, HEAP_HEADER_AND_CHAIN_SLOTID, HEAP_NUM_BEST_SPACESTATS, heap_stats_del_bestspace_by_vpid(), heap_vpid_next(), heap_vpid_prev(), HFID_IS_NULL, hfid::hpgid, i, heap_hdr_stats::last_vpid, recdes::length, log_append_undoredo_data2(), log_sysop_abort(), log_sysop_commit(), log_sysop_start(), MAX_ALIGNMENT, heap_hdr_stats::next_vpid, heap_chain::next_vpid, NO_ERROR, NULL, heap_hdr_stats::num_high_best, OLD_PAGE, pgbuf_watcher::page_was_unfixed, vpid::pageid, pgbuf_attach_watcher, pgbuf_get_vpid(), pgbuf_has_any_waiters(), pgbuf_has_prevent_dealloc(), PGBUF_INIT_WATCHER, PGBUF_LATCH_WRITE, pgbuf_ordered_fix, PGBUF_ORDERED_HEAP_HDR, PGBUF_ORDERED_HEAP_NORMAL, pgbuf_ordered_unfix, pgbuf_ordered_unfix_and_init, pgbuf_set_dirty(), pgbuf_watcher::pgptr, heap_chain::prev_vpid, PTR_ALIGN, RVHF_CHAIN, RVHF_STATS, S_SUCCESS, heap_hdr_stats::second_best, SP_SUCCESS, spage_get_record(), spage_number_of_records(), spage_update(), vacuum_er_log, vacuum_er_log_error, VACUUM_ER_LOG_HEAP, vacuum_er_log_warning, hfid::vfid, vpid::volid, vfid::volid, heap_bestspace::vpid, VPID_COPY, VPID_EQ, VPID_INITIALIZER, VPID_ISNULL, and VPID_SET_NULL.

Referenced by vacuum_heap_page().

Here is the caller graph for this function:

static const HFID * heap_reuse ( THREAD_ENTRY thread_p,
const HFID hfid,
const OID class_oid,
const bool  reuse_oid 
)
static

Definition at line 5512 of file heap_file.c.

References ARG_FILE_LINE, assert, heap_hdr_stats::best, heap_hdr_stats::class_oid, heap_chain::class_oid, COPY_OID, recdes::data, DB_PAGESIZE, DISK_ERROR, DISK_INVALID, disk_is_page_sector_reserved(), DISK_VALID, ER_FATAL_ERROR_SEVERITY, ER_GENERIC_ERROR, er_log_debug, er_set(), error(), heap_hdr_stats::estimates, vfid::fileid, heap_chain::flags, FREE, heap_bestspace::freespace, heap_hdr_stats::head, heap_delete_all_page_records(), HEAP_HEADER_AND_CHAIN_SLOTID, HEAP_NUM_BEST_SPACESTATS, HEAP_PAGE_SET_VACUUM_STATUS, HEAP_PAGE_VACUUM_NONE, heap_reinitialize_page(), heap_stats_add_bestspace(), heap_vpid_next(), HFID_IS_NULL, hfid::hpgid, i, heap_hdr_stats::last_vpid, log_append_redo_data(), heap_chain::max_mvccid, MVCCID_NULL, NO_ERROR, NULL, heap_hdr_stats::num_high_best, heap_hdr_stats::num_other_high_best, heap_hdr_stats::num_pages, heap_hdr_stats::num_recs, log_data_addr::offset, OID_ISNULL, OLD_PAGE, heap_hdr_stats::ovf_vfid, PAGE_HEAP, vpid::pageid, PEEK, pgbuf_check_page_ptype(), pgbuf_fix, PGBUF_LATCH_WRITE, pgbuf_set_dirty(), PGBUF_UNCONDITIONAL_LATCH, pgbuf_unfix_and_init, log_data_addr::pgptr, prm_get_float_value(), prm_get_integer_value(), PRM_ID_HF_MAX_BESTSPACE_ENTRIES, PRM_ID_HF_UNFILL_FACTOR, heap_hdr_stats::recs_sumlen, RVHF_REUSE_PAGE, RVHF_REUSE_PAGE_REUSE_OID, RVHF_STATS, S_SUCCESS, heap_scanrange::scan_cache, spage_get_free_space_without_saving(), spage_get_record(), spage_number_of_slots(), heap_hdr_stats::unfill_space, log_data_addr::vfid, hfid::vfid, VFID_SET_NULL, vpid::volid, vfid::volid, heap_bestspace::vpid, VPID_ISNULL, and VPID_SET_NULL.

Referenced by heap_create_internal().

Here is the caller graph for this function:

void heap_rv_dump_append_pages_to_heap ( FILE *  fp,
int  length,
void *  data 
)
void heap_rv_dump_chain ( FILE *  fp,
int  ignore_length,
void *  data 
)
void heap_rv_dump_reuse_page ( FILE *  fp,
int  ignore_length,
void *  ignore_data 
)

Definition at line 16382 of file heap_file.c.

void heap_rv_dump_statistics ( FILE *  fp,
int  ignore_length,
void *  data 
)

Definition at line 15533 of file heap_file.c.

References heap_dump_hdr(), and NO_ERROR.

int heap_rv_mark_deleted_on_postpone ( THREAD_ENTRY thread_p,
LOG_RCV rcv 
)

Definition at line 5877 of file heap_file.c.

References assert_release, file_rv_tracker_mark_heap_deleted(), and NO_ERROR.

int heap_rv_mark_deleted_on_undo ( THREAD_ENTRY thread_p,
LOG_RCV rcv 
)

Definition at line 5859 of file heap_file.c.

References assert_release, file_rv_tracker_mark_heap_deleted(), and NO_ERROR.

int heap_rv_nop ( THREAD_ENTRY thread_p,
LOG_RCV rcv 
)

Definition at line 23862 of file heap_file.c.

References assert, DONT_FREE, NO_ERROR, NULL, pgbuf_set_dirty(), and log_rcv::pgptr.

int heap_rv_redo_delete ( THREAD_ENTRY thread_p,
LOG_RCV rcv 
)
int heap_rv_redo_mark_reusable_slot ( THREAD_ENTRY thread_p,
LOG_RCV rcv 
)
int heap_rv_redo_update ( THREAD_ENTRY thread_p,
LOG_RCV rcv 
)

Definition at line 16236 of file heap_file.c.

References heap_rv_undoredo_update().

Referenced by heap_rv_redo_update_and_update_chain().

Here is the caller graph for this function:

int heap_rv_redo_update_and_update_chain ( THREAD_ENTRY thread_p,
LOG_RCV rcv 
)
INT16 heap_rv_remove_flags_from_offset ( INT16  offset)

Definition at line 23901 of file heap_file.c.

References HEAP_RV_FLAG_VACUUM_STATUS_CHANGE.

Referenced by vacuum_process_log_block().

Here is the caller graph for this function:

int heap_rv_undo_insert ( THREAD_ENTRY thread_p,
LOG_RCV rcv 
)
int heap_rv_undo_ovf_update ( THREAD_ENTRY thread_p,
LOG_RCV rcv 
)
int heap_rv_undoredo_update ( THREAD_ENTRY thread_p,
LOG_RCV rcv 
)
int heap_rv_update_chain_after_mvcc_op ( THREAD_ENTRY thread_p,
LOG_RCV rcv 
)
int heap_scan_cache_allocate_area ( THREAD_ENTRY thread_p,
HEAP_SCANCACHE scan_cache_p,
int  size 
)
static int heap_scan_cache_allocate_recdes_data ( THREAD_ENTRY thread_p,
HEAP_SCANCACHE scan_cache_p,
RECDES recdes_p,
int  size 
)
static

Definition at line 24761 of file heap_file.c.

References assert, heap_scancache::assign_recdes_to_area(), NO_ERROR, and NULL.

Referenced by heap_get_record_data_when_all_ready().

Here is the caller graph for this function:

SCAN_CODE heap_scan_get_visible_version ( THREAD_ENTRY thread_p,
const OID oid,
OID class_oid,
RECDES recdes,
HEAP_SCANCACHE scan_cache,
int  ispeeking,
int  old_chn 
)

Definition at line 24309 of file heap_file.c.

References heap_clean_get_context(), heap_get_visible_version_internal(), heap_init_get_context(), and S_SUCCESS.

Referenced by heap_next_internal().

Here is the caller graph for this function:

static PAGE_PTR heap_scan_pb_lock_and_fetch_debug ( THREAD_ENTRY thread_p,
const VPID vpid_ptr,
PAGE_FETCH_MODE  fetch_mode,
LOCK  lock,
HEAP_SCANCACHE scan_cache,
PGBUF_WATCHER pg_watcher,
const char *  caller_file,
const int  caller_line 
)
static
static void heap_scancache_block_allocate ( cubmem::block b,
size_t  size 
)
static
static void heap_scancache_block_deallocate ( cubmem::block b)
static

Definition at line 24933 of file heap_file.c.

References db_private_free_and_init, cubmem::block::dim, NULL, and cubmem::block::ptr.

static int heap_scancache_check_with_hfid ( THREAD_ENTRY thread_p,
HFID hfid,
OID class_oid,
HEAP_SCANCACHE **  scan_cache 
)
static

Definition at line 6673 of file heap_file.c.

References ARG_FILE_LINE, er_log_debug, HEAP_DEBUG_SCANCACHE_INITPATTERN, heap_scancache_reset_modify(), HFID_EQ, NO_ERROR, NULL, and OID_ISNULL.

Referenced by heap_delete_logical(), heap_insert_logical(), and heap_update_logical().

Here is the caller graph for this function:

int heap_scancache_end ( THREAD_ENTRY thread_p,
HEAP_SCANCACHE scan_cache 
)

Definition at line 7195 of file heap_file.c.

References END_SCAN, heap_scancache_end_internal(), and NO_ERROR.

Referenced by boot_db_parm_update_heap(), boot_get_db_parm(), btree_scan_for_show_index_header(), btree_sort_get_next(), catalog_check_consistency(), catalog_dump(), catalog_get_dir_oid_from_cache(), catalog_get_rep_dir(), catalog_get_representation(), catcls_compile_catalog_classes(), catcls_get_apply_info_log_record_time(), catcls_get_db_collation(), catcls_get_server_compat_info(), css_make_access_status_exist_user(), heap_class_get_partition_info(), heap_classrepr_dump(), heap_classrepr_dump_all(), heap_classrepr_get_from_record(), heap_dump(), heap_get_class_info_from_record(), heap_get_class_name_alloc_if_diff(), heap_get_class_subclasses(), heap_get_class_supers(), heap_get_class_tde_algorithm(), heap_get_partition_attributes(), heap_is_object_not_null(), heap_last(), heap_scanrange_end(), heap_set_autoincrement_value(), locator_all_reference_lockset(), locator_check_all_entries_of_all_btrees(), locator_check_btree_entries(), locator_check_by_class_oid(), locator_check_class_names(), locator_check_primary_key_delete(), locator_check_primary_key_update(), locator_check_unique_btree_entries(), locator_delete_lob_force(), locator_guess_sub_classes(), locator_initialize(), locator_move_record(), locator_mvcc_reeval_scan_filters(), lock_demote_class_lock(), or_get_hierarchy_helper(), partition_clear_pruning_context(), process_value(), qexec_execute_build_columns(), qexec_execute_build_indexes(), qexec_execute_obj_fetch(), qexec_execute_selupd_list(), redistribute_partition_data(), cubload::server_class_installer::register_class_with_attributes(), scan_end_scan(), serial_load_attribute_info_of_db_serial(), serial_update_cur_val_of_serial(), tde_get_keyinfo(), tde_update_keyinfo(), update_indexes(), xboot_checkdb_table(), xbtree_load_index(), xbtree_load_online_index(), xcatalog_check_rep_dir(), xheap_has_instance(), xlocator_check_fk_validity(), xlocator_does_exist(), xlocator_fetch(), xlocator_fetch_all(), xlocator_fetch_lockhint_classes(), xlocator_fetch_lockset(), xlocator_lock_and_fetch_all(), xlocator_remove_class_from_index(), xserial_get_current_value_internal(), xserial_get_next_value_internal(), and xstats_update_all_statistics().

static int heap_scancache_end_internal ( THREAD_ENTRY thread_p,
HEAP_SCANCACHE scan_cache,
bool  scan_state 
)
static
int heap_scancache_end_when_scan_will_resume ( THREAD_ENTRY thread_p,
HEAP_SCANCACHE scan_cache 
)

Definition at line 7210 of file heap_file.c.

References CONTINUE_SCAN, heap_scancache_end_internal(), and NO_ERROR.

Referenced by xlocator_fetch_all(), and xlocator_lock_and_fetch_all().

Here is the caller graph for this function:

static int heap_scancache_force_modify ( THREAD_ENTRY thread_p,
HEAP_SCANCACHE scan_cache 
)
static
int heap_scancache_quick_start ( HEAP_SCANCACHE scan_cache)
int heap_scancache_quick_start_modify ( HEAP_SCANCACHE scan_cache)
int heap_scancache_quick_start_modify_with_class_oid ( THREAD_ENTRY thread_p,
HEAP_SCANCACHE scan_cache,
OID class_oid 
)

Definition at line 19331 of file heap_file.c.

References heap_get_class_info(), heap_scancache_quick_start_internal(), NO_ERROR, NULL, heap_scancache::page_latch, and X_LOCK.

Referenced by serial_update_cur_val_of_serial(), and xserial_get_next_value_internal().

Here is the caller graph for this function:

int heap_scancache_quick_start_with_class_hfid ( THREAD_ENTRY thread_p,
HEAP_SCANCACHE scan_cache,
const HFID hfid 
)
int heap_scancache_quick_start_with_class_oid ( THREAD_ENTRY thread_p,
HEAP_SCANCACHE scan_cache,
OID class_oid 
)
void heap_scanrange_end ( THREAD_ENTRY thread_p,
HEAP_SCANRANGE scan_range 
)

Definition at line 8238 of file heap_file.c.

References heap_scanrange::first_oid, heap_scancache_end(), heap_scanrange::last_oid, OID_SET_NULL, and heap_scanrange::scan_cache.

Referenced by scan_end_scan().

Here is the caller graph for this function:

int heap_scanrange_start ( THREAD_ENTRY thread_p,
HEAP_SCANRANGE scan_range,
const HFID hfid,
const OID class_oid,
MVCC_SNAPSHOT mvcc_snapshot 
)
bool heap_should_try_update_stat ( const int  current_freespace,
const int  prev_freespace 
)

Definition at line 23916 of file heap_file.c.

References HEAP_DROP_FREE_SPACE.

static PAGE_PTR heap_stats_find_best_page ( THREAD_ENTRY thread_p,
const HFID hfid,
int  needed_space,
bool  isnew_rec,
int  newrec_size,
HEAP_SCANCACHE space_cache,
PGBUF_WATCHER pg_watcher 
)
static
static int heap_stats_get_min_freespace ( HEAP_HDR_STATS heap_hdr)
static
static int heap_update_and_log_header ( THREAD_ENTRY thread_p,
const HFID hfid,
const PGBUF_WATCHER  heap_header_watcher,
HEAP_HDR_STATS heap_hdr,
const VPID  new_next_vpid,
const VPID  new_last_vpid,
const int  new_num_pages 
)
static
static int heap_update_bigone ( THREAD_ENTRY thread_p,
HEAP_OPERATION_CONTEXT context,
bool  is_mvcc_op 
)
static

Definition at line 21568 of file heap_file.c.

References assert, ASSERT_ERROR, ASSERT_ERROR_AND_SET, COPY, COPY_OID, recdes::data, DONT_FREE, ER_FAILED, FREE, heap_build_forwarding_recdes(), heap_fix_header_page(), heap_get_bigone_content(), heap_insert_newhome(), heap_is_big_length(), heap_log_update_physical(), heap_mvcc_log_home_no_change(), HEAP_OPERATION_UPDATE, heap_ovf_delete(), heap_ovf_find_vfid(), heap_ovf_update(), HEAP_PERF_TRACK_EXECUTE, HEAP_PERF_TRACK_LOGGING, HEAP_PERF_TRACK_PREPARE, heap_update_physical(), heap_operation_context::hfid, heap_operation_context::home_page_watcher_p, heap_operation_context::home_recdes, recdes::length, log_append_undo_recdes2(), logtb_find_current_tran_lsa(), NO_ERROR, NULL, heap_operation_context::oid, OLD_PAGE, or_mvcc_set_log_lsa_to_record(), heap_operation_context::overflow_page_watcher_p, heap_operation_context::ovf_oid, heap_hdr_stats::ovf_vfid, perfmon_inc_stat(), pgbuf_fix, PGBUF_LATCH_WRITE, pgbuf_set_dirty(), PGBUF_UNCONDITIONAL_LATCH, pgbuf_watcher::pgptr, PSTAT_HEAP_BIG_UPDATES, REC_HOME, REC_NEWHOME, REC_RELOCATION, RECDES_INITIALIZER, heap_operation_context::recdes_p, heap_operation_context::record_type, heap_operation_context::res_oid, RVHF_MVCC_UPDATE_OVERFLOW, RVHF_UPDATE, RVHF_UPDATE_NOTIFY_VACUUM, S_SUCCESS, heap_operation_context::scan_cache_p, db_identifier::slotid, SP_SUCCESS, spage_update(), spage_update_record_type(), recdes::type, heap_operation_context::type, hfid::vfid, and VPID_GET_FROM_OID.

Referenced by heap_update_logical().

Here is the caller graph for this function:

static int heap_update_home ( THREAD_ENTRY thread_p,
HEAP_OPERATION_CONTEXT context,
bool  is_mvcc_op 
)
static

Definition at line 22024 of file heap_file.c.

References recdes::area_size, ARG_FILE_LINE, assert, ASSERT_ERROR, ASSERT_ERROR_AND_SET, heap_operation_context::class_oid, COPY, COPY_OID, ER_FAILED, er_log_debug, heap_operation_context::forward_page_watcher_p, heap_build_forwarding_recdes(), heap_fix_header_page(), heap_insert_newhome(), heap_is_big_length(), HEAP_IS_UPDATE_INPLACE, heap_log_update_physical(), HEAP_OPERATION_UPDATE, heap_ovf_insert(), HEAP_PERF_TRACK_EXECUTE, HEAP_PERF_TRACK_LOGGING, HEAP_PERF_TRACK_PREPARE, heap_update_physical(), heap_update_set_prev_version(), heap_operation_context::hfid, heap_operation_context::home_page_watcher_p, heap_operation_context::home_recdes, recdes::length, logtb_find_current_tran_lsa(), LSA_COPY(), mvcc_is_mvcc_disabled_class(), NO_ERROR, NULL, heap_operation_context::oid, pgbuf_watcher::page_was_unfixed, PEEK, perfmon_inc_stat(), PGBUF_INIT_WATCHER, PGBUF_ORDERED_HEAP_NORMAL, PGBUF_ORDERED_NULL_HFID, pgbuf_ordered_unfix, pgbuf_watcher::pgptr, PSTAT_HEAP_HOME_TO_BIG_UPDATES, PSTAT_HEAP_HOME_TO_REL_UPDATES, PSTAT_HEAP_HOME_UPDATES, REC_ASSIGN_ADDRESS, REC_BIGONE, REC_HOME, REC_NEWHOME, REC_RELOCATION, heap_operation_context::recdes_p, heap_operation_context::res_oid, RVHF_UPDATE, RVHF_UPDATE_NOTIFY_VACUUM, S_SUCCESS, db_identifier::slotid, spage_get_record(), spage_is_updatable(), recdes::type, heap_operation_context::type, heap_operation_context::update_in_place, and hfid::vfid.

Referenced by heap_update_logical().

Here is the caller graph for this function:

int heap_update_logical ( THREAD_ENTRY thread_p,
HEAP_OPERATION_CONTEXT context 
)

Definition at line 22771 of file heap_file.c.

References recdes::area_size, ARG_FILE_LINE, assert, ASSERT_ERROR, ASSERT_ERROR_AND_SET, heap_scancache::cache_last_fix_page, heap_operation_context::class_oid, COPY, recdes::data, DB_PAGESIZE, ER_ERROR_SEVERITY, ER_FAILED, ER_FATAL_ERROR_SEVERITY, ER_GENERIC_ERROR, ER_HEAP_BAD_OBJECT_TYPE, ER_HEAP_UNKNOWN_HEAP, ER_HEAP_UNKNOWN_OBJECT, ER_INTERRUPTED, er_log_debug, er_set(), FILE_HEAP, FILE_HEAP_REUSE_SLOTS, heap_operation_context::file_type, FILE_UNKNOWN_TYPE, heap_get_file_type(), heap_get_record_location(), HEAP_IS_UPDATE_INPLACE, heap_is_valid_oid(), heap_mark_class_as_modified(), HEAP_MAYNEED_DECACHE_GUESSED_LASTREPRS, HEAP_OPERATION_UPDATE, HEAP_PERF_START, HEAP_PERF_TRACK_PREPARE, heap_scancache_check_with_hfid(), heap_unfix_watchers(), heap_update_adjust_recdes_header(), heap_update_bigone(), heap_update_home(), HEAP_UPDATE_IS_MVCC_OP, heap_update_relocation(), heap_scancache_node::hfid, heap_operation_context::hfid, HFID_COPY, HFID_EQ, HFID_IS_NULL, heap_operation_context::home_page_watcher, heap_operation_context::home_page_watcher_p, heap_operation_context::home_recdes, heap_operation_context::home_recdes_buffer, heap_operation_context::is_logical_old, MAX_ALIGNMENT, mvcc_is_mvcc_disabled_class(), NO_ERROR, heap_scancache::node, NULL, NULL_FILEID, NULL_PAGEID, heap_operation_context::oid, OID_IS_ROOTOID, OID_ISNULL, or_chn(), heap_scancache::page_watcher, db_identifier::pageid, pgbuf_ordered_unfix, pgbuf_replace_watcher, pgbuf_watcher::pgptr, PTR_ALIGN, rc, REC_ASSIGN_ADDRESS, REC_BIGONE, REC_HOME, REC_RELOCATION, REC_UNKNOWN, heap_operation_context::recdes_p, heap_operation_context::record_type, heap_classrepr_cache::rootclass_hfid, S_SUCCESS, heap_operation_context::scan_cache_p, db_identifier::slotid, spage_get_record(), spage_get_record_type(), heap_operation_context::time_track, heap_operation_context::type, heap_operation_context::update_in_place, and db_identifier::volid.

Referenced by boot_db_parm_update_heap(), catcls_insert_instance(), catcls_update_instance(), disk_update_instance(), locator_insert_force(), locator_update_force(), and tde_update_keyinfo().

Here is the caller graph for this function:

static int heap_update_relocation ( THREAD_ENTRY thread_p,
HEAP_OPERATION_CONTEXT context,
bool  is_mvcc_op 
)
static

Definition at line 21744 of file heap_file.c.

References recdes::area_size, assert, ASSERT_ERROR, ASSERT_ERROR_AND_SET, COPY, COPY_OID, recdes::data, DB_PAGESIZE, DONT_FREE, ER_FAILED, heap_operation_context::forward_page_watcher_p, heap_build_forwarding_recdes(), heap_delete_physical(), heap_fix_forward_page(), heap_fix_header_page(), heap_insert_newhome(), heap_is_big_length(), heap_log_delete_physical(), heap_log_update_physical(), heap_mvcc_log_home_no_change(), HEAP_OPERATION_UPDATE, heap_ovf_insert(), HEAP_PERF_TRACK_EXECUTE, HEAP_PERF_TRACK_LOGGING, HEAP_PERF_TRACK_PREPARE, heap_update_physical(), heap_update_set_prev_version(), heap_operation_context::hfid, heap_operation_context::home_page_watcher_p, heap_operation_context::home_recdes, IO_MAX_PAGE_SIZE, recdes::length, logtb_find_current_tran_lsa(), LSA_COPY(), LSA_INITIALIZER, MAX_ALIGNMENT, NO_ERROR, NULL, log_data_addr::offset, heap_operation_context::oid, pgbuf_watcher::page_was_unfixed, perfmon_inc_stat(), PGBUF_INIT_WATCHER, PGBUF_ORDERED_HEAP_NORMAL, PGBUF_ORDERED_NULL_HFID, pgbuf_ordered_unfix, pgbuf_set_dirty(), log_data_addr::pgptr, pgbuf_watcher::pgptr, PSTAT_HEAP_REL_TO_BIG_UPDATES, PSTAT_HEAP_REL_TO_HOME_UPDATES, PSTAT_HEAP_REL_TO_REL_UPDATES, PSTAT_HEAP_REL_UPDATES, PTR_ALIGN, rc, REC_BIGONE, REC_HOME, REC_NEWHOME, REC_RELOCATION, heap_operation_context::recdes_p, heap_operation_context::res_oid, RVHF_UPDATE, RVHF_UPDATE_NOTIFY_VACUUM, S_SUCCESS, db_identifier::slotid, spage_get_record(), spage_is_updatable(), recdes::type, heap_operation_context::type, log_data_addr::vfid, and hfid::vfid.

Referenced by heap_update_logical().

Here is the caller graph for this function:

static int heap_vpid_alloc ( THREAD_ENTRY thread_p,
const HFID hfid,
PAGE_PTR  hdr_pgptr,
HEAP_HDR_STATS heap_hdr,
HEAP_SCANCACHE scan_cache,
PGBUF_WATCHER new_pg_watcher 
)
static
int xheap_create ( THREAD_ENTRY thread_p,
HFID hfid,
const OID class_oid,
bool  reuse_oid 
)

Definition at line 5772 of file heap_file.c.

References heap_create_internal().

Referenced by boot_create_all_volumes(), heap_create(), and shf_create().

Here is the caller graph for this function:

int xheap_get_class_num_objects_pages ( THREAD_ENTRY thread_p,
const HFID hfid,
int  approximation,
int *  nobjs,
int *  npages 
)

Definition at line 16396 of file heap_file.c.

References assert, er_errid(), ER_FAILED, heap_estimate(), heap_get_num_objects(), HFID_IS_NULL, and NO_ERROR.

Referenced by heap_get_class_num_objects_pages(), and shf_get_class_num_objs_and_pages().

Here is the caller graph for this function:

int xheap_has_instance ( THREAD_ENTRY thread_p,
const HFID hfid,
OID class_oid,
int  has_visible_instance 
)

Definition at line 16429 of file heap_file.c.

References recdes::data, ER_FAILED, heap_first(), heap_scancache_end(), heap_scancache_start(), logtb_get_mvcc_snapshot(), NO_ERROR, NULL, OID_SET_NULL, S_DOESNT_EXIST, S_END, and S_ERROR.

Referenced by heap_has_instance(), and shf_has_instance().

Here is the caller graph for this function:

int xheap_reclaim_addresses ( THREAD_ENTRY thread_p,
const HFID hfid 
)

Definition at line 6122 of file heap_file.c.

References recdes::area_size, heap_hdr_stats::best, COPY, recdes::data, DONT_FREE, er_errid(), ER_FAILED, heap_hdr_stats::estimates, vfid::fileid, heap_bestspace::freespace, heap_hdr_stats::full_search_vpid, heap_hdr_stats::head, heap_hdr_stats::head_second_best, HEAP_DROP_FREE_SPACE, HEAP_HEADER_AND_CHAIN_SLOTID, HEAP_NUM_BEST_SPACESTATS, heap_page_get_max_mvccid(), heap_scan_pb_lock_and_fetch, heap_stats_add_bestspace(), heap_stats_put_second_best(), heap_vpid_prev(), heap_vpid_remove(), hfid::hpgid, i, heap_hdr_stats::last_vpid, log_append_undoredo_data(), log_skip_logging(), NO_ERROR, NULL, heap_hdr_stats::num_high_best, heap_hdr_stats::num_other_high_best, heap_hdr_stats::num_pages, heap_hdr_stats::num_recs, heap_hdr_stats::num_second_best, heap_hdr_stats::num_substitutions, log_data_addr::offset, OLD_PAGE, PAGE_HEAP, vpid::pageid, pgbuf_check_page_ptype(), PGBUF_INIT_WATCHER, PGBUF_LATCH_WRITE, pgbuf_ordered_fix, PGBUF_ORDERED_HEAP_HDR, PGBUF_ORDERED_HEAP_NORMAL, pgbuf_ordered_set_dirty_and_free(), pgbuf_ordered_unfix, pgbuf_set_dirty(), log_data_addr::pgptr, pgbuf_watcher::pgptr, prm_get_integer_value(), PRM_ID_HF_MAX_BESTSPACE_ENTRIES, heap_hdr_stats::recs_sumlen, RVHF_STATS, S_SUCCESS, heap_hdr_stats::second_best, SP_SUCCESS, spage_collect_statistics(), spage_get_free_space_without_saving(), spage_get_record(), spage_number_of_records(), spage_reclaim(), spage_update(), heap_hdr_stats::tail_second_best, vacuum_er_log, VACUUM_ER_LOG_HEAP, vacuum_is_mvccid_vacuumed(), log_data_addr::vfid, hfid::vfid, vpid::volid, vfid::volid, heap_bestspace::vpid, VPID_ISNULL, VPID_SET_NULL, and X_LOCK.

Referenced by heap_reclaim_addresses(), and shf_heap_reclaim_addresses().

Here is the caller graph for this function:

Variable Documentation

HEAP_STATS_BESTSPACE_CACHE* heap_Bestspace = NULL
static

Definition at line 502 of file heap_file.c.

HEAP_STATS_BESTSPACE_CACHE heap_Bestspace_cache_area
static
Initial value:
=
{ 0, NULL, NULL, 0, 0, 0, NULL, PTHREAD_MUTEX_INITIALIZER }
#define NULL
Definition: freelistheap.h:34

Definition at line 499 of file heap_file.c.

Referenced by heap_stats_bestspace_initialize().

HEAP_CLASSREPR_CACHE* heap_Classrepr = NULL
static

Definition at line 492 of file heap_file.c.

HEAP_CLASSREPR_CACHE heap_Classrepr_cache
static
Initial value:
= {
-1,
-1,
{
PTHREAD_MUTEX_INITIALIZER,
NULL},
{
PTHREAD_MUTEX_INITIALIZER,
-1},
}
#define NULL_PAGEID
#define NULL
Definition: freelistheap.h:34
#define NULL_FILEID
#define NULL_VOLID

Definition at line 381 of file heap_file.c.

Referenced by heap_classrepr_initialize_cache().

const int heap_Find_best_page_limit = 100
static

Definition at line 490 of file heap_file.c.

Referenced by heap_stats_sync_bestspace().

HEAP_CHNGUESS* heap_Guesschn = NULL
static

Definition at line 497 of file heap_file.c.

HEAP_CHNGUESS heap_Guesschn_area
static
Initial value:
= { NULL, NULL, NULL, false, 0,
0, 0, 0
}
#define NULL
Definition: freelistheap.h:34

Definition at line 493 of file heap_file.c.

Referenced by heap_chnguess_initialize().

HEAP_HFID_TABLE* heap_Hfid_table = NULL
static

Definition at line 508 of file heap_file.c.

HEAP_HFID_TABLE heap_Hfid_table_area
static
Initial value:
}
#define LF_HASH_TABLE_INITIALIZER
Definition: lock_free.h:317
#define LF_ENTRY_DESCRIPTOR_INITIALIZER
Definition: lock_free.h:109
#define LF_FREELIST_INITIALIZER
Definition: lock_free.h:248

Definition at line 504 of file heap_file.c.

Referenced by heap_initialize_hfid_table().

int heap_Maxslotted_reclength
static
const cubmem::block_allocator HEAP_SCANCACHE_BLOCK_ALLOCATOR
static
Initial value:
=
static void heap_scancache_block_allocate(cubmem::block &b, size_t size)
Definition: heap_file.c:24900
static void heap_scancache_block_deallocate(cubmem::block &b)
Definition: heap_file.c:24933

Definition at line 888 of file heap_file.c.

int heap_Slotted_overhead = 4
static