CUBRID Engine  latest
list_file.c File Reference
#include "config.h"
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <search.h>
#include <stddef.h>
#include <assert.h>
#include "list_file.h"
#include "binaryheap.h"
#include "db_value_printer.hpp"
#include "dbtype.h"
#include "error_manager.h"
#include "log_append.hpp"
#include "object_primitive.h"
#include "object_representation.h"
#include "query_manager.h"
#include "query_opfunc.h"
#include "stream_to_xasl.h"
#include "thread_entry.hpp"
#include "thread_manager.hpp"
#include "xasl.h"
#include "xasl_cache.h"

Go to the source code of this file.

Classes

struct  qfile_cleanup_candidate
 
struct  qfile_list_cache
 
struct  qfile_list_cache_candidate
 
union  qfile_pooled_list_cache_entry
 
struct  qfile_list_cache_entry_pool
 

Macros

#define pthread_mutex_init(a, b)
 
#define pthread_mutex_destroy(a)
 
#define pthread_mutex_lock(a)   0
 
#define pthread_mutex_unlock(a)
 
#define thread_sleep(a)
 
#define QFILE_CHECK_LIST_FILE_IS_CLOSED(list_id)
 
#define QFILE_DEFAULT_PAGES   4
 
#define LS_PUT_NEXT_VPID(ptr)
 
#define FIXED_SIZE_OF_POOLED_LIST_CACHE_ENTRY   4096
 
#define ADDITION_FOR_POOLED_LIST_CACHE_ENTRY   offsetof(QFILE_POOLED_LIST_CACHE_ENTRY, s.entry)
 
#define POOLED_LIST_CACHE_ENTRY_FROM_LIST_CACHE_ENTRY(p)   ((QFILE_POOLED_LIST_CACHE_ENTRY *) ((char*) p - ADDITION_FOR_POOLED_LIST_CACHE_ENTRY))
 

Typedefs

typedef struct qfile_cleanup_candidate QFILE_CACHE_CLEANUP_CANDIDATE
 
typedef SCAN_CODE(* ADVANCE_FUCTION) (THREAD_ENTRY *thread_p, QFILE_LIST_SCAN_ID *, QFILE_TUPLE_RECORD *, QFILE_LIST_SCAN_ID *, QFILE_TUPLE_RECORD *, QFILE_TUPLE_VALUE_TYPE_LIST *)
 
typedef struct qfile_list_cache QFILE_LIST_CACHE
 
typedef struct qfile_list_cache_candidate QFILE_LIST_CACHE_CANDIDATE
 
typedef union qfile_pooled_list_cache_entry QFILE_POOLED_LIST_CACHE_ENTRY
 
typedef struct qfile_list_cache_entry_pool QFILE_LIST_CACHE_ENTRY_POOL
 

Functions

static void * qfile_alloc_sort_list (void)
 
static int qfile_dealloc_sort_list (void *sort_list)
 
static int qfile_get_sort_list_size (SORT_LIST *sort_list)
 
static int qfile_compare_tuple_values (QFILE_TUPLE tplp1, QFILE_TUPLE tplp2, TP_DOMAIN *domain, int *cmp)
 
static void qfile_initialize_page_header (PAGE_PTR page_p)
 
static void qfile_set_dirty_page_and_skip_logging (THREAD_ENTRY *thread_p, PAGE_PTR page_p, VFID *vfid_p, int free_page)
 
static bool qfile_is_first_tuple (QFILE_LIST_ID *list_id_p)
 
static bool qfile_is_last_page_full (QFILE_LIST_ID *list_id_p, int tuple_length, const bool is_ovf_page)
 
static void qfile_set_dirty_page (THREAD_ENTRY *thread_p, PAGE_PTR page_p, int free_page, QMGR_TEMP_FILE *vfid_p)
 
static PAGE_PTR qfile_allocate_new_page (THREAD_ENTRY *thread_p, QFILE_LIST_ID *list_id_p, PAGE_PTR page_p, bool is_ovf_page)
 
static PAGE_PTR qfile_allocate_new_ovf_page (THREAD_ENTRY *thread_p, QFILE_LIST_ID *list_id_p, PAGE_PTR page_p, PAGE_PTR prev_page_p, int tuple_length, int offset, int *tuple_page_size_p)
 
static int qfile_allocate_new_page_if_need (THREAD_ENTRY *thread_p, QFILE_LIST_ID *list_id_p, PAGE_PTR *page_p, int tuple_length, bool is_ovf_page)
 
static void qfile_add_tuple_to_list_id (QFILE_LIST_ID *list_id_p, PAGE_PTR page_p, int tuple_length, int written_tuple_length)
 
static int qfile_save_single_bound_item_tuple (QFILE_TUPLE_DESCRIPTOR *tuple_descr_p, char *tuple_p, char *page_p, int tuple_length)
 
static int qfile_save_normal_tuple (QFILE_TUPLE_DESCRIPTOR *tuple_descr_p, char *tuple_p, char *page_p, int tuple_length)
 
static int qfile_save_sort_key_tuple (QFILE_TUPLE_DESCRIPTOR *tuple_descr_p, char *tuple_p, char *page_p, int tuple_length)
 
static int qfile_save_merge_tuple (QFILE_TUPLE_DESCRIPTOR *tuple_descr_p, char *tuple_p, char *page_p, int *tuple_length_p)
 
static int qfile_compare_tuple_helper (QFILE_TUPLE lhs, QFILE_TUPLE rhs, QFILE_TUPLE_VALUE_TYPE_LIST *types, int *cmp)
 
static SCAN_CODE qfile_advance_single (THREAD_ENTRY *thread_p, QFILE_LIST_SCAN_ID *next_scan, QFILE_TUPLE_RECORD *next_tpl, QFILE_LIST_SCAN_ID *last_scan, QFILE_TUPLE_RECORD *last_tpl, QFILE_TUPLE_VALUE_TYPE_LIST *types)
 
static SCAN_CODE qfile_advance_group (THREAD_ENTRY *thread_p, QFILE_LIST_SCAN_ID *next_scan, QFILE_TUPLE_RECORD *next_tpl, QFILE_LIST_SCAN_ID *last_scan, QFILE_TUPLE_RECORD *last_tpl, QFILE_TUPLE_VALUE_TYPE_LIST *types)
 
static int qfile_add_one_tuple (THREAD_ENTRY *thread_p, QFILE_LIST_ID *dst, QFILE_TUPLE lhs, QFILE_TUPLE rhs)
 
static int qfile_add_two_tuple (THREAD_ENTRY *thread_p, QFILE_LIST_ID *dst, QFILE_TUPLE lhs, QFILE_TUPLE rhs)
 
static int qfile_advance (THREAD_ENTRY *thread_p, ADVANCE_FUCTION advance_func, QFILE_TUPLE_RECORD *side_p, QFILE_TUPLE_RECORD *last_side_p, QFILE_LIST_SCAN_ID *scan_p, QFILE_LIST_SCAN_ID *last_scan_p, QFILE_LIST_ID *side_file_p, int *have_side_p)
 
static int qfile_copy_tuple (THREAD_ENTRY *thread_p, QFILE_LIST_ID *to_list_id_p, QFILE_LIST_ID *from_list_id_p)
 
static void qfile_close_and_free_list_file (THREAD_ENTRY *thread_p, QFILE_LIST_ID *list_id)
 
static QFILE_LIST_IDqfile_union_list (THREAD_ENTRY *thread_p, QFILE_LIST_ID *list_id1, QFILE_LIST_ID *list_id2, int flag)
 
static SORT_STATUS qfile_get_next_sort_item (THREAD_ENTRY *thread_p, RECDES *recdes, void *arg)
 
static int qfile_put_next_sort_item (THREAD_ENTRY *thread_p, const RECDES *recdes, void *arg)
 
static SORT_INFOqfile_initialize_sort_info (SORT_INFO *info, QFILE_LIST_ID *listid, SORT_LIST *sort_list)
 
static void qfile_clear_sort_info (SORT_INFO *info)
 
static int qfile_copy_list_pages (THREAD_ENTRY *thread_p, VPID *old_first_vpidp, QMGR_TEMP_FILE *old_tfile_vfidp, VPID *new_first_vpidp, VPID *new_last_vpidp, QMGR_TEMP_FILE *new_tfile_vfidp)
 
static int qfile_get_tuple_from_current_list (THREAD_ENTRY *thread_p, QFILE_LIST_SCAN_ID *scan_id_p, QFILE_TUPLE_RECORD *tuple_record_p)
 
static SCAN_CODE qfile_scan_next (THREAD_ENTRY *thread_p, QFILE_LIST_SCAN_ID *s_id)
 
static SCAN_CODE qfile_scan_prev (THREAD_ENTRY *thread_p, QFILE_LIST_SCAN_ID *s_id)
 
static SCAN_CODE qfile_retrieve_tuple (THREAD_ENTRY *thread_p, QFILE_LIST_SCAN_ID *scan_id_p, QFILE_TUPLE_RECORD *tuple_record_p, int peek)
 
static SCAN_CODE qfile_scan_list (THREAD_ENTRY *thread_p, QFILE_LIST_SCAN_ID *scan_id_p, SCAN_CODE(*scan_func)(THREAD_ENTRY *thread_p, QFILE_LIST_SCAN_ID *), QFILE_TUPLE_RECORD *tuple_record_p, int peek)
 
static unsigned int qfile_hash_db_value_array (const void *key, unsigned int htsize)
 
static int qfile_compare_equal_db_value_array (const void *key1, const void *key2)
 
static int qfile_assign_list_cache (void)
 
static QFILE_LIST_CACHE_ENTRYqfile_allocate_list_cache_entry (int req_size)
 
static int qfile_free_list_cache_entry (THREAD_ENTRY *thread_p, void *data, void *args)
 
static int qfile_print_list_cache_entry (THREAD_ENTRY *thread_p, FILE *fp, const void *key, void *data, void *args)
 
static void qfile_add_uncommitted_list_cache_entry (int tran_index, QFILE_LIST_CACHE_ENTRY *lent)
 
static void qfile_delete_uncommitted_list_cache_entry (int tran_index, QFILE_LIST_CACHE_ENTRY *lent)
 
static int qfile_delete_list_cache_entry (THREAD_ENTRY *thread_p, void *data)
 
static int qfile_end_use_of_list_cache_entry_local (THREAD_ENTRY *thread_p, void *data, void *args)
 
static bool qfile_is_early_time (struct timeval *a, struct timeval *b)
 
static int qfile_get_list_cache_entry_size_for_allocate (int nparam)
 
static DB_VALUEqfile_get_list_cache_entry_param_values (QFILE_LIST_CACHE_ENTRY *ent)
 
static int qfile_compare_with_null_value (int o0, int o1, SUBKEY_INFO key_info)
 
static int qfile_compare_with_interpolation_domain (char *fp0, char *fp1, SUBKEY_INFO *subkey, SORTKEY_INFO *key_info)
 
int qfile_modify_type_list (QFILE_TUPLE_VALUE_TYPE_LIST *type_list_p, QFILE_LIST_ID *list_id_p)
 
int qfile_copy_list_id (QFILE_LIST_ID *dest_list_id_p, const QFILE_LIST_ID *src_list_id_p, bool is_include_sort_list)
 
QFILE_LIST_IDqfile_clone_list_id (const QFILE_LIST_ID *list_id_p, bool is_include_sort_list)
 
void qfile_clear_list_id (QFILE_LIST_ID *list_id_p)
 
void qfile_free_list_id (QFILE_LIST_ID *list_id_p)
 
void qfile_free_sort_list (THREAD_ENTRY *thread_p, SORT_LIST *sort_list_p)
 
SORT_LISTqfile_allocate_sort_list (THREAD_ENTRY *thread_p, int count)
 
bool qfile_is_sort_list_covered (SORT_LIST *covering_list_p, SORT_LIST *covered_list_p)
 
int qfile_unify_types (QFILE_LIST_ID *list_id1_p, const QFILE_LIST_ID *list_id2_p)
 
QFILE_TUPLE_VALUE_FLAG qfile_locate_tuple_value (QFILE_TUPLE tuple, int index, char **tuple_value_p, int *value_size_p)
 
QFILE_TUPLE_VALUE_FLAG qfile_locate_tuple_value_r (QFILE_TUPLE tuple, int index, char **tuple_value_p, int *value_size_p)
 
int qfile_locate_tuple_next_value (OR_BUF *iterator, OR_BUF *buf, QFILE_TUPLE_VALUE_FLAG *flag)
 
void qfile_load_xasl_node_header (THREAD_ENTRY *thread_p, char *xasl_stream, xasl_node_header *xasl_header_p)
 
int qfile_initialize (void)
 
void qfile_finalize (void)
 
QFILE_LIST_IDqfile_open_list (THREAD_ENTRY *thread_p, QFILE_TUPLE_VALUE_TYPE_LIST *type_list_p, SORT_LIST *sort_list_p, QUERY_ID query_id, int flag)
 
void qfile_close_list (THREAD_ENTRY *thread_p, QFILE_LIST_ID *list_id_p)
 
int qfile_reopen_list_as_append_mode (THREAD_ENTRY *thread_p, QFILE_LIST_ID *list_id_p)
 
int qfile_add_tuple_to_list (THREAD_ENTRY *thread_p, QFILE_LIST_ID *list_id_p, QFILE_TUPLE tuple)
 
int qfile_save_tuple (QFILE_TUPLE_DESCRIPTOR *tuple_descr_p, QFILE_TUPLE_TYPE tuple_type, char *page_p, int *tuple_length_p)
 
int qfile_generate_tuple_into_list (THREAD_ENTRY *thread_p, QFILE_LIST_ID *list_id_p, QFILE_TUPLE_TYPE tuple_type)
 
int qfile_fast_intint_tuple_to_list (THREAD_ENTRY *thread_p, QFILE_LIST_ID *list_id_p, int v1, int v2)
 
int qfile_fast_intval_tuple_to_list (THREAD_ENTRY *thread_p, QFILE_LIST_ID *list_id_p, int v1, DB_VALUE *v2)
 
int qfile_fast_val_tuple_to_list (THREAD_ENTRY *thread_p, QFILE_LIST_ID *list_id_p, DB_VALUE *val)
 
int qfile_add_overflow_tuple_to_list (THREAD_ENTRY *thread_p, QFILE_LIST_ID *list_id_p, PAGE_PTR ovf_tuple_page_p, QFILE_LIST_ID *input_list_id_p)
 
int qfile_get_first_page (THREAD_ENTRY *thread_p, QFILE_LIST_ID *list_id_p)
 
void qfile_destroy_list (THREAD_ENTRY *thread_p, QFILE_LIST_ID *list_id_p)
 
int xqfile_get_list_file_page (THREAD_ENTRY *thread_p, QUERY_ID query_id, VOLID vol_id, PAGEID page_id, char *page_buf_p, int *page_size_p)
 
int qfile_add_item_to_list (THREAD_ENTRY *thread_p, char *item_p, int item_size, QFILE_LIST_ID *list_id_p)
 
QFILE_LIST_IDqfile_combine_two_list (THREAD_ENTRY *thread_p, QFILE_LIST_ID *lhs_file_p, QFILE_LIST_ID *rhs_file_p, int flag)
 
int qfile_copy_tuple_descr_to_tuple (THREAD_ENTRY *thread_p, QFILE_TUPLE_DESCRIPTOR *tpl_descr, QFILE_TUPLE_RECORD *tplrec)
 
int qfile_reallocate_tuple (QFILE_TUPLE_RECORD *tuple_record_p, int tuple_size)
 
SORT_STATUS qfile_make_sort_key (THREAD_ENTRY *thread_p, SORTKEY_INFO *key_info_p, RECDES *key_record_p, QFILE_LIST_SCAN_ID *input_scan_p, QFILE_TUPLE_RECORD *tuple_record_p)
 
QFILE_TUPLE qfile_generate_sort_tuple (SORTKEY_INFO *key_info_p, SORT_REC *sort_record_p, RECDES *output_recdes_p)
 
int qfile_compare_partial_sort_record (const void *pk0, const void *pk1, void *arg)
 
int qfile_compare_all_sort_record (const void *pk0, const void *pk1, void *arg)
 
int qfile_get_estimated_pages_for_sorting (QFILE_LIST_ID *list_id_p, SORTKEY_INFO *key_info_p)
 
SORTKEY_INFOqfile_initialize_sort_key_info (SORTKEY_INFO *key_info_p, SORT_LIST *list_p, QFILE_TUPLE_VALUE_TYPE_LIST *types)
 
void qfile_clear_sort_key_info (SORTKEY_INFO *key_info_p)
 
QFILE_LIST_IDqfile_sort_list_with_func (THREAD_ENTRY *thread_p, QFILE_LIST_ID *list_id_p, SORT_LIST *sort_list_p, QUERY_OPTIONS option, int flag, SORT_GET_FUNC *get_func, SORT_PUT_FUNC *put_func, SORT_CMP_FUNC *cmp_func, void *extra_arg, int limit, bool do_close)
 
QFILE_LIST_IDqfile_sort_list (THREAD_ENTRY *thread_p, QFILE_LIST_ID *list_id_p, SORT_LIST *sort_list_p, QUERY_OPTIONS option, bool do_close)
 
QFILE_LIST_IDqfile_duplicate_list (THREAD_ENTRY *thread_p, QFILE_LIST_ID *list_id_p, int flag)
 
int qfile_get_tuple (THREAD_ENTRY *thread_p, PAGE_PTR first_page_p, QFILE_TUPLE tuple, QFILE_TUPLE_RECORD *tuple_record_p, QFILE_LIST_ID *list_id_p)
 
void qfile_save_current_scan_tuple_position (QFILE_LIST_SCAN_ID *scan_id_p, QFILE_TUPLE_POSITION *tuple_position_p)
 
SCAN_CODE qfile_jump_scan_tuple_position (THREAD_ENTRY *thread_p, QFILE_LIST_SCAN_ID *scan_id_p, QFILE_TUPLE_POSITION *tuple_position_p, QFILE_TUPLE_RECORD *tuple_record_p, int peek)
 
int qfile_start_scan_fix (THREAD_ENTRY *thread_p, QFILE_LIST_SCAN_ID *scan_id_p)
 
int qfile_open_list_scan (QFILE_LIST_ID *list_id_p, QFILE_LIST_SCAN_ID *scan_id_p)
 
SCAN_CODE qfile_scan_list_next (THREAD_ENTRY *thread_p, QFILE_LIST_SCAN_ID *scan_id_p, QFILE_TUPLE_RECORD *tuple_record_p, int peek)
 
SCAN_CODE qfile_scan_list_prev (THREAD_ENTRY *thread_p, QFILE_LIST_SCAN_ID *scan_id_p, QFILE_TUPLE_RECORD *tuple_record_p, int peek)
 
void qfile_end_scan_fix (THREAD_ENTRY *thread_p, QFILE_LIST_SCAN_ID *scan_id_p)
 
void qfile_close_scan (THREAD_ENTRY *thread_p, QFILE_LIST_SCAN_ID *scan_id_p)
 
int qfile_initialize_list_cache (THREAD_ENTRY *thread_p)
 
int qfile_finalize_list_cache (THREAD_ENTRY *thread_p)
 
int qfile_clear_list_cache (THREAD_ENTRY *thread_p, int list_ht_no)
 
int qfile_dump_list_cache_internal (THREAD_ENTRY *thread_p, FILE *fp)
 
QFILE_LIST_CACHE_ENTRYqfile_lookup_list_cache_entry (THREAD_ENTRY *thread_p, int list_ht_no, const DB_VALUE_ARRAY *params, bool *result_cached)
 
QFILE_LIST_CACHE_ENTRYqfile_update_list_cache_entry (THREAD_ENTRY *thread_p, int list_ht_no, const DB_VALUE_ARRAY *params, const QFILE_LIST_ID *list_id, XASL_CACHE_ENTRY *xasl)
 
int qfile_end_use_of_list_cache_entry (THREAD_ENTRY *thread_p, QFILE_LIST_CACHE_ENTRY *lent, bool marker)
 
int qfile_add_tuple_get_pos_in_list (THREAD_ENTRY *thread_p, QFILE_LIST_ID *list_id_p, QFILE_TUPLE tuple, QFILE_TUPLE_POSITION *tuple_pos)
 
bool qfile_has_next_page (PAGE_PTR page_p)
 
int qfile_update_domains_on_type_list (THREAD_ENTRY *thread_p, QFILE_LIST_ID *list_id_p, valptr_list_node *valptr_list_p)
 
int qfile_set_tuple_column_value (THREAD_ENTRY *thread_p, QFILE_LIST_ID *list_id_p, PAGE_PTR curr_page_p, VPID *vpid_p, QFILE_TUPLE tuple_p, int col_num, DB_VALUE *value_p, TP_DOMAIN *domain_p)
 
int qfile_overwrite_tuple (THREAD_ENTRY *thread_p, PAGE_PTR first_page_p, QFILE_TUPLE tuple, QFILE_TUPLE_RECORD *tuple_record_p, QFILE_LIST_ID *list_id_p)
 
void qfile_update_qlist_count (THREAD_ENTRY *thread_p, const QFILE_LIST_ID *list_p, int inc)
 
int qfile_get_list_cache_number_of_entries (int ht_no)
 
bool qfile_has_no_cache_entries ()
 

Variables

static int rv
 
static const int RESERVED_SIZE_FOR_LIST_CACHE_ENTRY
 
static QFILE_LIST_CACHE qfile_List_cache = { NULL, 0, 0, 0, 0, 0, 0, 0 }
 
static QFILE_LIST_CACHE_CANDIDATE qfile_List_cache_candidate = { 0, 0, 0, 0, NULL, NULL, NULL, 0, 0, false }
 
static QFILE_LIST_CACHE_ENTRY_POOL qfile_List_cache_entry_pool = { NULL, 0, 0 }
 
static LF_FREELIST qfile_sort_list_Freelist
 
static LF_ENTRY_DESCRIPTOR qfile_sort_list_entry_desc
 
int qfile_Is_list_cache_disabled
 
static int qfile_Max_tuple_page_size
 

Macro Definition Documentation

#define ADDITION_FOR_POOLED_LIST_CACHE_ENTRY   offsetof(QFILE_POOLED_LIST_CACHE_ENTRY, s.entry)

Definition at line 125 of file list_file.c.

Referenced by qfile_allocate_list_cache_entry().

#define FIXED_SIZE_OF_POOLED_LIST_CACHE_ENTRY   4096

Definition at line 124 of file list_file.c.

#define LS_PUT_NEXT_VPID (   ptr)
Value:
do \
{ \
} \
while (0)
#define NULL_PAGEID
#define QFILE_NEXT_PAGE_ID_OFFSET
Definition: query_list.h:52
#define QFILE_NEXT_VOL_ID_OFFSET
Definition: query_list.h:56
#define OR_PUT_SHORT(ptr, val)
#define OR_PUT_INT(ptr, val)
while(1)
Definition: cnvlex.c:816
#define NULL_VOLID

Definition at line 75 of file list_file.c.

Referenced by qfile_allocate_new_page(), and qfile_get_first_page().

#define POOLED_LIST_CACHE_ENTRY_FROM_LIST_CACHE_ENTRY (   p)    ((QFILE_POOLED_LIST_CACHE_ENTRY *) ((char*) p - ADDITION_FOR_POOLED_LIST_CACHE_ENTRY))

Definition at line 127 of file list_file.c.

Referenced by qfile_free_list_cache_entry().

#define pthread_mutex_destroy (   a)

Definition at line 54 of file list_file.c.

#define pthread_mutex_init (   a,
 
)

Definition at line 53 of file list_file.c.

#define pthread_mutex_lock (   a)    0

Definition at line 55 of file list_file.c.

#define pthread_mutex_unlock (   a)

Definition at line 56 of file list_file.c.

#define QFILE_DEFAULT_PAGES   4

Definition at line 64 of file list_file.c.

#define thread_sleep (   a)

Definition at line 59 of file list_file.c.

Referenced by qfile_clear_list_cache().

Typedef Documentation

Definition at line 91 of file list_file.c.

Definition at line 84 of file list_file.c.

Definition at line 95 of file list_file.c.

Definition at line 108 of file list_file.c.

Definition at line 148 of file list_file.c.

Function Documentation

static int qfile_add_one_tuple ( THREAD_ENTRY thread_p,
QFILE_LIST_ID dst,
QFILE_TUPLE  lhs,
QFILE_TUPLE  rhs 
)
static

Definition at line 2515 of file list_file.c.

References qfile_add_tuple_to_list().

Referenced by qfile_combine_two_list().

Here is the caller graph for this function:

static void qfile_add_tuple_to_list_id ( QFILE_LIST_ID list_id_p,
PAGE_PTR  page_p,
int  tuple_length,
int  written_tuple_length 
)
static
static int qfile_add_two_tuple ( THREAD_ENTRY thread_p,
QFILE_LIST_ID dst,
QFILE_TUPLE  lhs,
QFILE_TUPLE  rhs 
)
static

Definition at line 2528 of file list_file.c.

References error(), NO_ERROR, and qfile_add_tuple_to_list().

Referenced by qfile_combine_two_list().

Here is the caller graph for this function:

static void qfile_add_uncommitted_list_cache_entry ( int  tran_index,
QFILE_LIST_CACHE_ENTRY lent 
)
static
static int qfile_advance ( THREAD_ENTRY thread_p,
ADVANCE_FUCTION  advance_func,
QFILE_TUPLE_RECORD side_p,
QFILE_TUPLE_RECORD last_side_p,
QFILE_LIST_SCAN_ID scan_p,
QFILE_LIST_SCAN_ID last_scan_p,
QFILE_LIST_ID side_file_p,
int *  have_side_p 
)
static

Definition at line 2542 of file list_file.c.

References ER_FAILED, NO_ERROR, S_END, S_SUCCESS, and qfile_list_id::type_list.

Referenced by qfile_combine_two_list().

Here is the caller graph for this function:

static SCAN_CODE qfile_advance_group ( THREAD_ENTRY thread_p,
QFILE_LIST_SCAN_ID next_scan,
QFILE_TUPLE_RECORD next_tpl,
QFILE_LIST_SCAN_ID last_scan,
QFILE_TUPLE_RECORD last_tpl,
QFILE_TUPLE_VALUE_TYPE_LIST types 
)
static
static SCAN_CODE qfile_advance_single ( THREAD_ENTRY thread_p,
QFILE_LIST_SCAN_ID next_scan,
QFILE_TUPLE_RECORD next_tpl,
QFILE_LIST_SCAN_ID last_scan,
QFILE_TUPLE_RECORD last_tpl,
QFILE_TUPLE_VALUE_TYPE_LIST types 
)
static

Definition at line 2434 of file list_file.c.

References NULL, PEEK, qfile_scan_list_next(), and S_END.

Referenced by qfile_combine_two_list().

Here is the caller graph for this function:

static void * qfile_alloc_sort_list ( void  )
static

Definition at line 658 of file list_file.c.

static PAGE_PTR qfile_allocate_new_ovf_page ( THREAD_ENTRY thread_p,
QFILE_LIST_ID list_id_p,
PAGE_PTR  page_p,
PAGE_PTR  prev_page_p,
int  tuple_length,
int  offset,
int *  tuple_page_size_p 
)
static
SORT_LIST* qfile_allocate_sort_list ( THREAD_ENTRY thread_p,
int  count 
)
static int qfile_assign_list_cache ( void  )
static
void qfile_clear_sort_key_info ( SORTKEY_INFO key_info_p)
QFILE_LIST_ID* qfile_clone_list_id ( const QFILE_LIST_ID list_id_p,
bool  is_include_sort_list 
)

Definition at line 501 of file list_file.c.

References DB_SIZEOF, free_and_init, NO_ERROR, and qfile_copy_list_id().

Referenced by qfile_union_list(), qmgr_process_query(), and xqmgr_execute_query().

Here is the caller graph for this function:

static void qfile_close_and_free_list_file ( THREAD_ENTRY thread_p,
QFILE_LIST_ID list_id 
)
static

Definition at line 2924 of file list_file.c.

References qfile_close_list(), and QFILE_FREE_AND_INIT_LIST_ID.

Referenced by qfile_sort_list_with_func().

Here is the caller graph for this function:

int qfile_compare_all_sort_record ( const void *  pk0,
const void *  pk1,
void *  arg 
)
static int qfile_compare_equal_db_value_array ( const void *  key1,
const void *  key2 
)
static

Definition at line 4847 of file list_file.c.

References i, mht_compare_dbvalues_are_equal(), NULL, db_value_array::size, and db_value_array::vals.

Referenced by qfile_initialize_list_cache().

Here is the caller graph for this function:

static int qfile_compare_tuple_helper ( QFILE_TUPLE  lhs,
QFILE_TUPLE  rhs,
QFILE_TUPLE_VALUE_TYPE_LIST types,
int *  cmp 
)
static
static int qfile_compare_tuple_values ( QFILE_TUPLE  tplp1,
QFILE_TUPLE  tplp2,
TP_DOMAIN domain,
int *  cmp 
)
static
static int qfile_compare_with_null_value ( int  o0,
int  o1,
SUBKEY_INFO  key_info 
)
static

Definition at line 3640 of file list_file.c.

References assert, and SUBKEY_INFO::is_nulls_first.

Referenced by qfile_compare_all_sort_record(), and qfile_compare_partial_sort_record().

Here is the caller graph for this function:

static int qfile_copy_list_pages ( THREAD_ENTRY thread_p,
VPID old_first_vpidp,
QMGR_TEMP_FILE old_tfile_vfidp,
VPID new_first_vpidp,
VPID new_last_vpidp,
QMGR_TEMP_FILE new_tfile_vfidp 
)
static
static int qfile_copy_tuple ( THREAD_ENTRY thread_p,
QFILE_LIST_ID to_list_id_p,
QFILE_LIST_ID from_list_id_p 
)
static

Definition at line 2886 of file list_file.c.

References ER_FAILED, NO_ERROR, NULL, PEEK, qfile_add_tuple_to_list(), qfile_close_scan(), qfile_open_list_scan(), qfile_scan_list_next(), S_END, S_SUCCESS, and qfile_tuple_record::tpl.

Referenced by qfile_union_list().

Here is the caller graph for this function:

static int qfile_dealloc_sort_list ( void *  sort_list)
static

Definition at line 669 of file list_file.c.

References NO_ERROR.

static void qfile_delete_uncommitted_list_cache_entry ( int  tran_index,
QFILE_LIST_CACHE_ENTRY lent 
)
static
void qfile_end_scan_fix ( THREAD_ENTRY thread_p,
QFILE_LIST_SCAN_ID scan_id_p 
)
static int qfile_end_use_of_list_cache_entry_local ( THREAD_ENTRY thread_p,
void *  data,
void *  args 
)
static

Definition at line 5464 of file list_file.c.

References qfile_end_use_of_list_cache_entry().

Referenced by qfile_clear_list_cache(), and qfile_finalize_list_cache().

Here is the caller graph for this function:

void qfile_finalize ( void  )

Definition at line 1117 of file list_file.c.

References lf_freelist_destroy().

Referenced by qmgr_finalize().

Here is the caller graph for this function:

void qfile_free_sort_list ( THREAD_ENTRY thread_p,
SORT_LIST sort_list_p 
)
int qfile_get_estimated_pages_for_sorting ( QFILE_LIST_ID list_id_p,
SORTKEY_INFO key_info_p 
)
static DB_VALUE * qfile_get_list_cache_entry_param_values ( QFILE_LIST_CACHE_ENTRY ent)
static

Definition at line 5971 of file list_file.c.

References MAX_NTRANS.

Referenced by qfile_update_list_cache_entry().

Here is the caller graph for this function:

static int qfile_get_list_cache_entry_size_for_allocate ( int  nparam)
static

Definition at line 5950 of file list_file.c.

References MAX_NTRANS.

Referenced by qfile_update_list_cache_entry().

Here is the caller graph for this function:

int qfile_get_list_cache_number_of_entries ( int  ht_no)

Definition at line 6486 of file list_file.c.

References assert_release, qfile_list_cache::list_hts, and mht_table::nentries.

Referenced by qfile_clear_list_cache(), and xcache_invalidate_qcaches().

Here is the caller graph for this function:

static SORT_STATUS qfile_get_next_sort_item ( THREAD_ENTRY thread_p,
RECDES recdes,
void *  arg 
)
static

Definition at line 3312 of file list_file.c.

References SORT_INFO::key_info, qfile_make_sort_key(), SORT_INFO::s_id, qfile_sort_scan_id::s_id, and qfile_sort_scan_id::tplrec.

Referenced by qfile_sort_list_with_func().

Here is the caller graph for this function:

static int qfile_get_sort_list_size ( SORT_LIST sort_list)
static

Definition at line 682 of file list_file.c.

References sort_list::next.

Referenced by qfile_copy_list_id(), qfile_initialize_sort_key_info(), and qfile_open_list().

Here is the caller graph for this function:

static int qfile_get_tuple_from_current_list ( THREAD_ENTRY thread_p,
QFILE_LIST_SCAN_ID scan_id_p,
QFILE_TUPLE_RECORD tuple_record_p 
)
static

Definition at line 4286 of file list_file.c.

References qfile_list_scan_id::curr_offset, qfile_list_scan_id::curr_pgptr, qfile_list_scan_id::list_id, and qfile_get_tuple().

Referenced by qfile_retrieve_tuple().

Here is the caller graph for this function:

bool qfile_has_next_page ( PAGE_PTR  page_p)

Definition at line 6066 of file list_file.c.

References NULL_PAGEID, NULL_PAGEID_IN_PROGRESS, and QFILE_GET_NEXT_PAGE_ID.

Referenced by qfile_scan_next().

Here is the caller graph for this function:

bool qfile_has_no_cache_entries ( )

Definition at line 6494 of file list_file.c.

References qfile_list_cache::n_entries.

Referenced by qmgr_clear_trans_wakeup(), and xcache_invalidate_entries().

Here is the caller graph for this function:

static unsigned int qfile_hash_db_value_array ( const void *  key,
unsigned int  htsize 
)
static

Definition at line 4819 of file list_file.c.

References i, mht_valhash(), NULL, db_value_array::size, and db_value_array::vals.

Referenced by qfile_initialize_list_cache().

Here is the caller graph for this function:

static SORT_INFO * qfile_initialize_sort_info ( SORT_INFO info,
QFILE_LIST_ID listid,
SORT_LIST sort_list 
)
static
static bool qfile_is_early_time ( struct timeval *  a,
struct timeval *  b 
)
static

Definition at line 5600 of file list_file.c.

static bool qfile_is_first_tuple ( QFILE_LIST_ID list_id_p)
static

Definition at line 1339 of file list_file.c.

References qfile_list_id::first_vpid, and VPID_ISNULL.

Referenced by qfile_allocate_new_page_if_need().

Here is the caller graph for this function:

static bool qfile_is_last_page_full ( QFILE_LIST_ID list_id_p,
int  tuple_length,
const bool  is_ovf_page 
)
static

Definition at line 1345 of file list_file.c.

References assert, DB_PAGESIZE, qfile_list_id::last_offset, and QFILE_PAGE_HEADER_SIZE.

Referenced by qfile_allocate_new_page_if_need().

Here is the caller graph for this function:

bool qfile_is_sort_list_covered ( SORT_LIST covering_list_p,
SORT_LIST covered_list_p 
)
void qfile_load_xasl_node_header ( THREAD_ENTRY thread_p,
char *  xasl_stream,
xasl_node_header xasl_header_p 
)

Definition at line 1063 of file list_file.c.

References assert, INIT_XASL_NODE_HEADER, NO_ERROR, NULL, and stx_map_stream_to_xasl_node_header().

Referenced by xqmgr_prepare_query(), and xsession_get_prepared_statement().

Here is the caller graph for this function:

QFILE_TUPLE_VALUE_FLAG qfile_locate_tuple_value_r ( QFILE_TUPLE  tuple,
int  index,
char **  tuple_value_p,
int *  value_size_p 
)

Definition at line 922 of file list_file.c.

References i, QFILE_GET_TUPLE_VALUE_FLAG, QFILE_GET_TUPLE_VALUE_LENGTH, QFILE_TUPLE_VALUE_HEADER_SIZE, V_BOUND, and V_UNBOUND.

Referenced by fetch_peek_dbval_pos(), and qfile_locate_tuple_value().

Here is the caller graph for this function:

QFILE_LIST_ID* qfile_open_list ( THREAD_ENTRY thread_p,
QFILE_TUPLE_VALUE_TYPE_LIST type_list_p,
SORT_LIST sort_list_p,
QUERY_ID  query_id,
int  flag 
)

Definition at line 1142 of file list_file.c.

References DB_SIZEOF, qfile_tuple_value_position::dom, qfile_tuple_value_type_list::domp, free_and_init, i, sort_list::next, NULL, qfile_list_id::page_cnt, sort_list::pos_descr, qfile_tuple_value_position::pos_no, qfile_allocate_sort_list(), QFILE_CLEAR_LIST_ID, QFILE_FLAG_DISTINCT, QFILE_FLAG_RESULT_FILE, QFILE_FLAG_USE_KEY_BUFFER, qfile_get_sort_list_size(), QFILE_IS_FLAG_SET, QFILE_IS_LIST_CACHE_DISABLED, qfile_update_qlist_count(), qmgr_create_new_temp_file(), qmgr_create_result_file(), qfile_list_id::query_id, S_ASC, sort_list::s_nulls, S_NULLS_FIRST, sort_list::s_order, qfile_list_id::sort_list, TEMP_FILE_MEMBUF_KEY_BUFFER, TEMP_FILE_MEMBUF_NORMAL, qmgr_temp_file::temp_vfid, qfile_list_id::temp_vfid, qfile_list_id::tfile_vfid, qfile_list_id::tuple_cnt, qfile_tuple_value_type_list::type_cnt, qfile_list_id::type_list, and VFID_COPY.

Referenced by qdata_initialize_analytic_func(), qdata_process_distinct_or_sort(), qexec_alloc_agg_hash_context(), qexec_end_buildvalueblock_iterations(), qexec_execute_analytic(), qexec_execute_connect_by(), qexec_groupby(), qexec_groupby_index(), qexec_initialize_analytic_function_state(), qexec_merge_list(), qexec_merge_list_outer(), qexec_start_connect_by_lists(), qexec_start_mainblock_iterations(), qfile_combine_two_list(), qfile_duplicate_list(), qfile_sort_list_with_func(), scan_init_indx_coverage(), scan_next_index_scan(), and scan_reset_scan_block().

Here is the caller graph for this function:

static int qfile_save_normal_tuple ( QFILE_TUPLE_DESCRIPTOR tuple_descr_p,
char *  tuple_p,
char *  page_p,
int  tuple_length 
)
static
static int qfile_save_single_bound_item_tuple ( QFILE_TUPLE_DESCRIPTOR tuple_descr_p,
char *  tuple_p,
char *  page_p,
int  tuple_length 
)
static
static int qfile_save_sort_key_tuple ( QFILE_TUPLE_DESCRIPTOR tuple_descr_p,
char *  tuple_p,
char *  page_p,
int  tuple_length 
)
static
int qfile_save_tuple ( QFILE_TUPLE_DESCRIPTOR tuple_descr_p,
QFILE_TUPLE_TYPE  tuple_type,
char *  page_p,
int *  tuple_length_p 
)
static SCAN_CODE qfile_scan_list ( THREAD_ENTRY thread_p,
QFILE_LIST_SCAN_ID scan_id_p,
SCAN_CODE(*)(THREAD_ENTRY *thread_p, QFILE_LIST_SCAN_ID *)  scan_func,
QFILE_TUPLE_RECORD tuple_record_p,
int  peek 
)
static

Definition at line 4701 of file list_file.c.

References qfile_retrieve_tuple(), and S_SUCCESS.

Referenced by qfile_scan_list_next(), and qfile_scan_list_prev().

Here is the caller graph for this function:

SCAN_CODE qfile_scan_list_prev ( THREAD_ENTRY thread_p,
QFILE_LIST_SCAN_ID scan_id_p,
QFILE_TUPLE_RECORD tuple_record_p,
int  peek 
)

Definition at line 4738 of file list_file.c.

References qfile_scan_list(), and qfile_scan_prev().

Referenced by qexec_analytic_value_advance(), and scan_prev_scan_local().

Here is the caller graph for this function:

static void qfile_set_dirty_page_and_skip_logging ( THREAD_ENTRY thread_p,
PAGE_PTR  page_p,
VFID vfid_p,
int  free_page 
)
static
QFILE_LIST_ID* qfile_sort_list ( THREAD_ENTRY thread_p,
QFILE_LIST_ID list_id_p,
SORT_LIST sort_list_p,
QUERY_OPTIONS  option,
bool  do_close 
)
static QFILE_LIST_ID * qfile_union_list ( THREAD_ENTRY thread_p,
QFILE_LIST_ID list_id1,
QFILE_LIST_ID list_id2,
int  flag 
)
static
QFILE_LIST_CACHE_ENTRY* qfile_update_list_cache_entry ( THREAD_ENTRY thread_p,
int  list_ht_no,
const DB_VALUE_ARRAY params,
const QFILE_LIST_ID list_id,
XASL_CACHE_ENTRY xasl 
)
void qfile_update_qlist_count ( THREAD_ENTRY thread_p,
const QFILE_LIST_ID list_p,
int  inc 
)

Variable Documentation

int qfile_Is_list_cache_disabled

Definition at line 193 of file list_file.c.

Referenced by qfile_initialize().

QFILE_LIST_CACHE qfile_List_cache = { NULL, 0, 0, 0, 0, 0, 0, 0 }
static

Definition at line 161 of file list_file.c.

QFILE_LIST_CACHE_CANDIDATE qfile_List_cache_candidate = { 0, 0, 0, 0, NULL, NULL, NULL, 0, 0, false }
static

Definition at line 164 of file list_file.c.

QFILE_LIST_CACHE_ENTRY_POOL qfile_List_cache_entry_pool = { NULL, 0, 0 }
static

Definition at line 167 of file list_file.c.

LF_ENTRY_DESCRIPTOR qfile_sort_list_entry_desc
static
Initial value:
= {
offsetof (SORT_LIST, local_next),
offsetof (SORT_LIST, next),
offsetof (SORT_LIST, del_id),
0,
0,
NULL
}
#define LF_EM_NOT_USING_MUTEX
Definition: lock_free.h:59
static int qfile_dealloc_sort_list(void *sort_list)
Definition: list_file.c:669
#define NULL
Definition: freelistheap.h:34
static void * qfile_alloc_sort_list(void)
Definition: list_file.c:658

Definition at line 175 of file list_file.c.

LF_FREELIST qfile_sort_list_Freelist
static

Definition at line 170 of file list_file.c.

const int RESERVED_SIZE_FOR_LIST_CACHE_ENTRY
static
Initial value:
=
#define ADDITION_FOR_POOLED_LIST_CACHE_ENTRY
Definition: list_file.c:125
#define FIXED_SIZE_OF_POOLED_LIST_CACHE_ENTRY
Definition: list_file.c:124

Definition at line 145 of file list_file.c.

Referenced by qfile_allocate_list_cache_entry().

int rv
static

Definition at line 57 of file list_file.c.