CUBRID Engine  latest
external_sort.h File Reference
#include "error_manager.h"
#include "query_list.h"
#include "storage_common.h"
#include "thread_compat.hpp"
Include dependency graph for external_sort.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SORT_REC
 
struct  SUBKEY_INFO
 
struct  SORTKEY_INFO
 
struct  SORT_INFO
 

Macros

#define SORT_PUT_STOP   2
 
#define NO_SORT_LIMIT   (-1)
 
#define SORT_RECORD_LENGTH_SIZE   (sizeof(INT64)) /* for 8byte align */
 
#define SORT_RECORD_LENGTH(item_p)   (*((int *) ((item_p) - SORT_RECORD_LENGTH_SIZE)))
 

Typedefs

typedef SORT_STATUS SORT_GET_FUNC(THREAD_ENTRY *thread_p, RECDES *, void *)
 
typedef int SORT_PUT_FUNC(THREAD_ENTRY *thread_p, const RECDES *, void *)
 
typedef int SORT_CMP_FUNC(const void *, const void *, void *)
 
typedef struct SORT_REC SORT_REC
 
typedef struct SUBKEY_INFO SUBKEY_INFO
 
typedef struct SORTKEY_INFO SORTKEY_INFO
 
typedef struct SORT_INFO SORT_INFO
 

Enumerations

enum  SORT_STATUS { SORT_REC_DOESNT_FIT, SORT_SUCCESS, SORT_NOMORE_RECS, SORT_ERROR_OCCURRED }
 
enum  SORT_DUP_OPTION { SORT_ELIM_DUP, SORT_DUP }
 

Functions

int sort_listfile (THREAD_ENTRY *thread_p, INT16 volid, int est_inp_pg_cnt, SORT_GET_FUNC *get_fn, void *get_arg, SORT_PUT_FUNC *put_fn, void *put_arg, SORT_CMP_FUNC *cmp_fn, void *cmp_arg, SORT_DUP_OPTION option, int limit, bool includes_tde_class)
 

Macro Definition Documentation

#define SORT_RECORD_LENGTH (   item_p)    (*((int *) ((item_p) - SORT_RECORD_LENGTH_SIZE)))

Definition at line 43 of file external_sort.h.

Referenced by btree_construct_leafs(), sort_inphase_sort(), and sort_run_flush().

#define SORT_RECORD_LENGTH_SIZE   (sizeof(INT64)) /* for 8byte align */

Definition at line 42 of file external_sort.h.

Referenced by sort_inphase_sort().

Typedef Documentation

typedef int SORT_CMP_FUNC(const void *, const void *, void *)

Definition at line 61 of file external_sort.h.

typedef SORT_STATUS SORT_GET_FUNC(THREAD_ENTRY *thread_p, RECDES *, void *)

Definition at line 59 of file external_sort.h.

typedef struct SORT_INFO SORT_INFO

Definition at line 66 of file external_sort.h.

typedef int SORT_PUT_FUNC(THREAD_ENTRY *thread_p, const RECDES *, void *)

Definition at line 60 of file external_sort.h.

typedef struct SORT_REC SORT_REC

Definition at line 63 of file external_sort.h.

typedef struct SORTKEY_INFO SORTKEY_INFO

Definition at line 65 of file external_sort.h.

typedef struct SUBKEY_INFO SUBKEY_INFO

Definition at line 64 of file external_sort.h.

Enumeration Type Documentation

Enumerator
SORT_ELIM_DUP 
SORT_DUP 

Definition at line 53 of file external_sort.h.

Enumerator
SORT_REC_DOESNT_FIT 
SORT_SUCCESS 
SORT_NOMORE_RECS 
SORT_ERROR_OCCURRED 

Definition at line 45 of file external_sort.h.

Function Documentation

int sort_listfile ( THREAD_ENTRY thread_p,
INT16  volid,
int  est_inp_pg_cnt,
SORT_GET_FUNC get_fn,
void *  get_arg,
SORT_PUT_FUNC put_fn,
void *  put_arg,
SORT_CMP_FUNC cmp_fn,
void *  cmp_arg,
SORT_DUP_OPTION  option,
int  limit,
bool  includes_tde_class 
)

Definition at line 1345 of file external_sort.c.

References ARG_FILE_LINE, assert_release, CEIL_PTVDIV, cleanup(), sort_param::cmp_arg, sort_param::cmp_fn, DB_PAGESIZE, db_private_alloc, ER_CSS_PTHREAD_MUTEX_INIT, ER_ERROR_SEVERITY, er_log_debug, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), error(), sort_param::file_contents, vfid::fileid, file_contents::first_run, free_and_init, sort_param::half_files, i, sort_param::in_half, sort_param::internal_memory, file_contents::last_run, sort_param::limit, sort_param::multipage_file, NO_ERROR, NULL, NULL_FILEID, NULL_VOLID, file_contents::num_pages, file_contents::num_slots, sort_param::option, prm_get_integer_value(), PRM_ID_SR_NBUFFERS, pthread_mutex_init, sort_param::put_arg, sort_param::put_fn, sort_param::px_array, sort_param::px_array_size, sort_param::px_height_max, rv, sort_add_new_file(), SORT_ELIM_DUP, sort_exphase_merge(), sort_exphase_merge_elim_dup(), sort_get_avg_numpages_of_nonempty_tmpfile(), sort_get_num_half_tmpfiles(), SORT_INITIAL_DYN_ARRAY_SIZE, sort_inphase_sort(), SORT_MAX_HALF_FILES, sort_return_used_resources(), sort_param::tde_encrypted, sort_param::temp, thread_set_sort_stats_active(), sort_param::tmp_file_pgs, sort_param::tot_buffers, sort_param::tot_runs, sort_param::tot_tempfiles, vol_list::vol_cnt, vol_list::vol_ent_cnt, vol_list::vol_info, sort_param::vol_list, vol_list::volid, and vfid::volid.

Referenced by btree_index_sort(), qexec_execute_analytic(), qexec_groupby(), and qfile_sort_list_with_func().

Here is the caller graph for this function: