diff options
author | Sergei Golubchik <sergii@pisem.net> | 2011-01-14 12:05:46 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2011-01-14 12:05:46 +0100 |
commit | eec32a33b73b8d2f820b936a71ed6ecf6d3d9a4b (patch) | |
tree | b4f32fc5ea62a6971ebdea31a39e9cd3276417ba /storage/maria/ma_unique.c | |
parent | 418df96d51b54bb1b20344dcaaee547aeee3708e (diff) | |
download | mariadb-git-eec32a33b73b8d2f820b936a71ed6ecf6d3d9a4b.tar.gz |
Optimize use of SEARCH_SAVE_BUFF in Aria
(less not-needed copies of key pages)
storage/maria/ma_rkey.c:
Fixed wrong test if SEARCH_SAVE_BUFF should be set.
Now we assume that if we are doing HA_READ_KEY_EXACT,
we don't have to copy the last key buffer
(in other words, it's not likely this will be followed
by a read-next call)
Diffstat (limited to 'storage/maria/ma_unique.c')
-rw-r--r-- | storage/maria/ma_unique.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/storage/maria/ma_unique.c b/storage/maria/ma_unique.c index 0c7a2a3cbcf..c7d277486c4 100644 --- a/storage/maria/ma_unique.c +++ b/storage/maria/ma_unique.c @@ -45,7 +45,8 @@ my_bool _ma_check_unique(MARIA_HA *info, MARIA_UNIQUEDEF *def, uchar *record, info->update&= ~HA_STATE_RNEXT_SAME; DBUG_ASSERT(key.data_length == MARIA_UNIQUE_HASH_LENGTH); - if (_ma_search(info, &key, SEARCH_FIND, info->s->state.key_root[def->key])) + if (_ma_search(info, &key, SEARCH_FIND | SEARCH_SAVE_BUFF, + info->s->state.key_root[def->key])) { info->page_changed=1; /* Can't optimize read next */ info->cur_row.lastpos= lastpos; |