Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
d36f4010
Commit
d36f4010
authored
Apr 25, 2014
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ft-index#218 use cursor set range with bound for point queries
parent
08d1e50a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
13 deletions
+13
-13
storage/tokudb/ha_tokudb.cc
storage/tokudb/ha_tokudb.cc
+12
-13
storage/tokudb/ha_tokudb.h
storage/tokudb/ha_tokudb.h
+1
-0
No files found.
storage/tokudb/ha_tokudb.cc
View file @
d36f4010
...
@@ -1809,7 +1809,8 @@ int ha_tokudb::open(const char *name, int mode, uint test_if_locked) {
...
@@ -1809,7 +1809,8 @@ int ha_tokudb::open(const char *name, int mode, uint test_if_locked) {
alloc_ptr
=
tokudb_my_multi_malloc
(
MYF
(
MY_WME
),
alloc_ptr
=
tokudb_my_multi_malloc
(
MYF
(
MY_WME
),
&
key_buff
,
max_key_length
,
&
key_buff
,
max_key_length
,
&
key_buff2
,
max_key_length
,
&
key_buff2
,
max_key_length
,
&
key_buff3
,
max_key_length
,
&
key_buff3
,
max_key_length
,
&
key_buff4
,
max_key_length
,
&
prelocked_left_range
,
max_key_length
,
&
prelocked_left_range
,
max_key_length
,
&
prelocked_right_range
,
max_key_length
,
&
prelocked_right_range
,
max_key_length
,
&
primary_key_buff
,
(
hidden_primary_key
?
0
:
max_key_length
),
&
primary_key_buff
,
(
hidden_primary_key
?
0
:
max_key_length
),
...
@@ -4864,31 +4865,31 @@ int ha_tokudb::index_read(uchar * buf, const uchar * key, uint key_len, enum ha_
...
@@ -4864,31 +4865,31 @@ int ha_tokudb::index_read(uchar * buf, const uchar * key, uint key_len, enum ha_
flags
=
SET_PRELOCK_FLAG
(
0
);
flags
=
SET_PRELOCK_FLAG
(
0
);
switch
(
find_flag
)
{
switch
(
find_flag
)
{
case
HA_READ_KEY_EXACT
:
/* Find first record else error */
case
HA_READ_KEY_EXACT
:
/* Find first record else error */
{
pack_key
(
&
lookup_key
,
tokudb_active_index
,
key_buff3
,
key
,
key_len
,
COL_NEG_INF
);
pack_key
(
&
lookup_key
,
tokudb_active_index
,
key_buff3
,
key
,
key_len
,
COL_NEG_INF
);
DBT
lookup_bound
;
pack_key
(
&
lookup_bound
,
tokudb_active_index
,
key_buff4
,
key
,
key_len
,
COL_POS_INF
);
if
(
tokudb_debug
&
TOKUDB_DEBUG_INDEX_KEY
)
{
if
(
tokudb_debug
&
TOKUDB_DEBUG_INDEX_KEY
)
{
TOKUDB_DBUG_DUMP
(
"tokudb key="
,
lookup_key
.
data
,
lookup_key
.
size
);
TOKUDB_DBUG_DUMP
(
"tokudb key="
,
lookup_key
.
data
,
lookup_key
.
size
);
}
}
ir_info
.
orig_key
=
&
lookup_key
;
ir_info
.
orig_key
=
&
lookup_key
;
error
=
cursor
->
c_getf_set_range
(
cursor
,
flags
,
&
lookup_key
,
SMART_DBT_IR_CALLBACK
(
key_read
),
&
ir_info
);
error
=
cursor
->
c_getf_set_range
_with_bound
(
cursor
,
flags
,
&
lookup_key
,
&
lookup_bound
,
SMART_DBT_IR_CALLBACK
(
key_read
),
&
ir_info
);
if
(
ir_info
.
cmp
)
{
if
(
ir_info
.
cmp
)
{
error
=
DB_NOTFOUND
;
error
=
DB_NOTFOUND
;
}
}
break
;
break
;
}
case
HA_READ_AFTER_KEY
:
/* Find next rec. after key-record */
case
HA_READ_AFTER_KEY
:
/* Find next rec. after key-record */
pack_key
(
&
lookup_key
,
tokudb_active_index
,
key_buff3
,
key
,
key_len
,
COL_POS_INF
);
pack_key
(
&
lookup_key
,
tokudb_active_index
,
key_buff3
,
key
,
key_len
,
COL_POS_INF
);
error
=
cursor
->
c_getf_set_range
(
cursor
,
flags
,
error
=
cursor
->
c_getf_set_range
(
cursor
,
flags
,
&
lookup_key
,
SMART_DBT_CALLBACK
(
key_read
),
&
info
);
&
lookup_key
,
SMART_DBT_CALLBACK
(
key_read
),
&
info
);
break
;
break
;
case
HA_READ_BEFORE_KEY
:
/* Find next rec. before key-record */
case
HA_READ_BEFORE_KEY
:
/* Find next rec. before key-record */
pack_key
(
&
lookup_key
,
tokudb_active_index
,
key_buff3
,
key
,
key_len
,
COL_NEG_INF
);
pack_key
(
&
lookup_key
,
tokudb_active_index
,
key_buff3
,
key
,
key_len
,
COL_NEG_INF
);
error
=
cursor
->
c_getf_set_range_reverse
(
cursor
,
flags
,
error
=
cursor
->
c_getf_set_range_reverse
(
cursor
,
flags
,
&
lookup_key
,
SMART_DBT_CALLBACK
(
key_read
),
&
info
);
&
lookup_key
,
SMART_DBT_CALLBACK
(
key_read
),
&
info
);
break
;
break
;
case
HA_READ_KEY_OR_NEXT
:
/* Record or next record */
case
HA_READ_KEY_OR_NEXT
:
/* Record or next record */
pack_key
(
&
lookup_key
,
tokudb_active_index
,
key_buff3
,
key
,
key_len
,
COL_NEG_INF
);
pack_key
(
&
lookup_key
,
tokudb_active_index
,
key_buff3
,
key
,
key_len
,
COL_NEG_INF
);
error
=
cursor
->
c_getf_set_range
(
cursor
,
flags
,
error
=
cursor
->
c_getf_set_range
(
cursor
,
flags
,
&
lookup_key
,
SMART_DBT_CALLBACK
(
key_read
),
&
info
);
&
lookup_key
,
SMART_DBT_CALLBACK
(
key_read
),
&
info
);
break
;
break
;
//
//
// This case does not seem to ever be used, it is ok for it to be slow
// This case does not seem to ever be used, it is ok for it to be slow
...
@@ -4896,8 +4897,7 @@ int ha_tokudb::index_read(uchar * buf, const uchar * key, uint key_len, enum ha_
...
@@ -4896,8 +4897,7 @@ int ha_tokudb::index_read(uchar * buf, const uchar * key, uint key_len, enum ha_
case
HA_READ_KEY_OR_PREV
:
/* Record or previous */
case
HA_READ_KEY_OR_PREV
:
/* Record or previous */
pack_key
(
&
lookup_key
,
tokudb_active_index
,
key_buff3
,
key
,
key_len
,
COL_NEG_INF
);
pack_key
(
&
lookup_key
,
tokudb_active_index
,
key_buff3
,
key
,
key_len
,
COL_NEG_INF
);
ir_info
.
orig_key
=
&
lookup_key
;
ir_info
.
orig_key
=
&
lookup_key
;
error
=
cursor
->
c_getf_set_range
(
cursor
,
flags
,
error
=
cursor
->
c_getf_set_range
(
cursor
,
flags
,
&
lookup_key
,
SMART_DBT_IR_CALLBACK
(
key_read
),
&
ir_info
);
&
lookup_key
,
SMART_DBT_IR_CALLBACK
(
key_read
),
&
ir_info
);
if
(
error
==
DB_NOTFOUND
)
{
if
(
error
==
DB_NOTFOUND
)
{
error
=
cursor
->
c_getf_last
(
cursor
,
flags
,
SMART_DBT_CALLBACK
(
key_read
),
&
info
);
error
=
cursor
->
c_getf_last
(
cursor
,
flags
,
SMART_DBT_CALLBACK
(
key_read
),
&
info
);
}
}
...
@@ -4907,8 +4907,7 @@ int ha_tokudb::index_read(uchar * buf, const uchar * key, uint key_len, enum ha_
...
@@ -4907,8 +4907,7 @@ int ha_tokudb::index_read(uchar * buf, const uchar * key, uint key_len, enum ha_
break
;
break
;
case
HA_READ_PREFIX_LAST_OR_PREV
:
/* Last or prev key with the same prefix */
case
HA_READ_PREFIX_LAST_OR_PREV
:
/* Last or prev key with the same prefix */
pack_key
(
&
lookup_key
,
tokudb_active_index
,
key_buff3
,
key
,
key_len
,
COL_POS_INF
);
pack_key
(
&
lookup_key
,
tokudb_active_index
,
key_buff3
,
key
,
key_len
,
COL_POS_INF
);
error
=
cursor
->
c_getf_set_range_reverse
(
cursor
,
flags
,
error
=
cursor
->
c_getf_set_range_reverse
(
cursor
,
flags
,
&
lookup_key
,
SMART_DBT_CALLBACK
(
key_read
),
&
info
);
&
lookup_key
,
SMART_DBT_CALLBACK
(
key_read
),
&
info
);
break
;
break
;
case
HA_READ_PREFIX_LAST
:
case
HA_READ_PREFIX_LAST
:
pack_key
(
&
lookup_key
,
tokudb_active_index
,
key_buff3
,
key
,
key_len
,
COL_POS_INF
);
pack_key
(
&
lookup_key
,
tokudb_active_index
,
key_buff3
,
key
,
key_len
,
COL_POS_INF
);
...
...
storage/tokudb/ha_tokudb.h
View file @
d36f4010
...
@@ -274,6 +274,7 @@ class ha_tokudb : public handler {
...
@@ -274,6 +274,7 @@ class ha_tokudb : public handler {
//
//
uchar
*
key_buff2
;
uchar
*
key_buff2
;
uchar
*
key_buff3
;
uchar
*
key_buff3
;
uchar
*
key_buff4
;
//
//
// 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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment