Commit 4905934f authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:3436], merge handlerton piece of bulk fetch to main line handlerton

git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@33944 c7de825b-a66e-492c-adef-691d508d4ae1
parent 8713618a
This diff is collapsed.
...@@ -173,6 +173,13 @@ class ha_tokudb : public handler { ...@@ -173,6 +173,13 @@ class ha_tokudb : public handler {
uchar *rec_update_buff; uchar *rec_update_buff;
ulong alloced_update_rec_buff_length; ulong alloced_update_rec_buff_length;
u_int32_t max_key_length; u_int32_t max_key_length;
uchar* range_query_buff; // range query buffer
u_int32_t size_range_query_buff; // size of the allocated range query buffer
u_int32_t bytes_used_in_range_query_buff; // number of bytes used in the range query buffer
u_int32_t curr_range_query_buff_offset; // current offset into the range query buffer for queries to read
bool doing_bulk_fetch;
// //
// buffer used to temporarily store a "packed key" // buffer used to temporarily store a "packed key"
// data pointer of a DBT will end up pointing to this // data pointer of a DBT will end up pointing to this
...@@ -195,6 +202,15 @@ class ha_tokudb : public handler { ...@@ -195,6 +202,15 @@ class ha_tokudb : public handler {
// //
uchar *primary_key_buff; uchar *primary_key_buff;
//
// ranges of prelocked area, used to know how much to bulk fetch
//
uchar *prelocked_left_range;
u_int32_t prelocked_left_range_size;
uchar *prelocked_right_range;
u_int32_t prelocked_right_range_size;
// //
// individual key buffer for each index // individual key buffer for each index
// //
...@@ -609,10 +625,21 @@ class ha_tokudb : public handler { ...@@ -609,10 +625,21 @@ class ha_tokudb : public handler {
int check(THD *thd, HA_CHECK_OPT *check_opt); int check(THD *thd, HA_CHECK_OPT *check_opt);
int fill_range_query_buf(
bool need_val,
DBT const *key,
DBT const *row,
int direction,
THD* thd
);
private: private:
int read_full_row(uchar * buf); int read_full_row(uchar * buf);
int __close(int mutex_is_locked); int __close(int mutex_is_locked);
int read_last(uint keynr); int read_last(uint keynr);
int get_next(uchar* buf, int direction);
int read_data_from_range_query_buff(uchar* buf, bool need_val);
void invalidate_bulk_fetch();
}; };
int open_status_dictionary(DB** ptr, const char* name, DB_TXN* txn); int open_status_dictionary(DB** ptr, const char* name, DB_TXN* txn);
......
...@@ -139,6 +139,18 @@ static MYSQL_THDVAR_UINT(read_block_size, ...@@ -139,6 +139,18 @@ static MYSQL_THDVAR_UINT(read_block_size,
1 // blocksize??? 1 // blocksize???
); );
static MYSQL_THDVAR_UINT(read_buf_size,
0,
"fractal tree read block size",
NULL,
NULL,
128*1024, // default
4096, // min
1*1024*1024, // max
1 // blocksize???
);
void tokudb_checkpoint_lock(THD * thd); void tokudb_checkpoint_lock(THD * thd);
void tokudb_checkpoint_unlock(THD * thd); void tokudb_checkpoint_unlock(THD * thd);
...@@ -609,6 +621,10 @@ uint get_tokudb_read_block_size(THD* thd) { ...@@ -609,6 +621,10 @@ uint get_tokudb_read_block_size(THD* thd) {
return THDVAR(thd, read_block_size); return THDVAR(thd, read_block_size);
} }
uint get_tokudb_read_buf_size(THD* thd) {
return THDVAR(thd, read_buf_size);
}
typedef struct txn_progress_info { typedef struct txn_progress_info {
char status[200]; char status[200];
THD* thd; THD* thd;
...@@ -1576,6 +1592,7 @@ static struct st_mysql_sys_var *tokudb_system_variables[] = { ...@@ -1576,6 +1592,7 @@ static struct st_mysql_sys_var *tokudb_system_variables[] = {
MYSQL_SYSVAR(tmp_dir), MYSQL_SYSVAR(tmp_dir),
MYSQL_SYSVAR(block_size), MYSQL_SYSVAR(block_size),
MYSQL_SYSVAR(read_block_size), MYSQL_SYSVAR(read_block_size),
MYSQL_SYSVAR(read_buf_size),
NULL NULL
}; };
......
...@@ -20,6 +20,7 @@ bool get_create_index_online(THD* thd); ...@@ -20,6 +20,7 @@ bool get_create_index_online(THD* thd);
bool get_prelock_empty(THD* thd); bool get_prelock_empty(THD* thd);
uint get_tokudb_block_size(THD* thd); uint get_tokudb_block_size(THD* thd);
uint get_tokudb_read_block_size(THD* thd); uint get_tokudb_read_block_size(THD* thd);
uint get_tokudb_read_buf_size(THD* thd);
extern HASH tokudb_open_tables; extern HASH tokudb_open_tables;
extern pthread_mutex_t tokudb_mutex; extern pthread_mutex_t tokudb_mutex;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment