summaryrefslogtreecommitdiff
path: root/innobase/row
diff options
context:
space:
mode:
authorunknown <marko@hundin.mysql.fi>2005-03-09 22:04:55 +0200
committerunknown <marko@hundin.mysql.fi>2005-03-09 22:04:55 +0200
commitdb32810d02ca5cae3a5619d5008923a197425e84 (patch)
tree806419ee88dc7ceffd87a90fcca8906aaa409538 /innobase/row
parentd1b3c64b230e35dccf33ac7bb70bdd52f779536b (diff)
downloadmariadb-git-db32810d02ca5cae3a5619d5008923a197425e84.tar.gz
InnoDB: Improve performance by about 10% by removing implicit
memcpy() calls, by not initializing the offsets_[] arrays. InnoDB: Remove a Microsoft compiler warning in page0page.c. innobase/btr/btr0btr.c: Only initialize the first element of offsets_[] innobase/btr/btr0cur.c: Only initialize the first element of offsets_[] innobase/btr/btr0sea.c: Only initialize the first element of offsets_[] innobase/lock/lock0lock.c: Only initialize the first element of offsets_[] innobase/page/page0cur.c: Only initialize the first element of offsets_[] innobase/page/page0page.c: page_validate(): Silence a warning about unsigned/signed comparison. Other places: Only initialize the first element of offsets_[]. innobase/rem/rem0rec.c: Only initialize the first element of offsets_[] innobase/row/row0ins.c: Only initialize the first element of offsets_[] innobase/row/row0mysql.c: Only initialize the first element of offsets_[] innobase/row/row0purge.c: Only initialize the first element of offsets_[] innobase/row/row0row.c: Only initialize the first element of offsets_[] innobase/row/row0sel.c: Only initialize the first element of offsets_[] innobase/row/row0undo.c: Only initialize the first element of offsets_[] innobase/row/row0upd.c: Only initialize the first element of offsets_[] innobase/trx/trx0rec.c: Only initialize the first element of offsets_[]
Diffstat (limited to 'innobase/row')
-rw-r--r--innobase/row/row0ins.c15
-rw-r--r--innobase/row/row0mysql.c3
-rw-r--r--innobase/row/row0purge.c3
-rw-r--r--innobase/row/row0row.c12
-rw-r--r--innobase/row/row0sel.c23
-rw-r--r--innobase/row/row0undo.c3
-rw-r--r--innobase/row/row0upd.c22
7 files changed, 52 insertions, 29 deletions
diff --git a/innobase/row/row0ins.c b/innobase/row/row0ins.c
index 87ed497ba1e..99a74501ade 100644
--- a/innobase/row/row0ins.c
+++ b/innobase/row/row0ins.c
@@ -1134,8 +1134,9 @@ row_ins_check_foreign_constraint(
mtr_t mtr;
trx_t* trx = thr_get_trx(thr);
mem_heap_t* heap = NULL;
- ulint offsets_[100] = { 100, };
+ ulint offsets_[100];
ulint* offsets = offsets_;
+ *offsets_ = (sizeof offsets_) / sizeof *offsets_;
run_again:
#ifdef UNIV_SYNC_DEBUG
@@ -1558,8 +1559,9 @@ row_ins_scan_sec_index_for_duplicate(
mtr_t mtr;
trx_t* trx;
mem_heap_t* heap = NULL;
- ulint offsets_[100] = { 100, };
+ ulint offsets_[100];
ulint* offsets = offsets_;
+ *offsets_ = (sizeof offsets_) / sizeof *offsets_;
n_unique = dict_index_get_n_unique(index);
@@ -1695,9 +1697,9 @@ row_ins_duplicate_error_in_clust(
ulint n_unique;
trx_t* trx = thr_get_trx(thr);
mem_heap_t*heap = NULL;
- ulint offsets_[100] = { 100, };
+ ulint offsets_[100];
ulint* offsets = offsets_;
-
+ *offsets_ = (sizeof offsets_) / sizeof *offsets_;
UT_NOT_USED(mtr);
@@ -1897,9 +1899,10 @@ row_ins_index_entry_low(
big_rec_t* big_rec = NULL;
mtr_t mtr;
mem_heap_t* heap = NULL;
- ulint offsets_[100] = { 100, };
+ ulint offsets_[100];
ulint* offsets = offsets_;
-
+ *offsets_ = (sizeof offsets_) / sizeof *offsets_;
+
log_free_check();
mtr_start(&mtr);
diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c
index 1ee3f7d380e..fd8c2b060ef 100644
--- a/innobase/row/row0mysql.c
+++ b/innobase/row/row0mysql.c
@@ -3673,8 +3673,9 @@ row_scan_and_check_index(
ibool contains_null;
ulint i;
mem_heap_t* heap = NULL;
- ulint offsets_[100] = { 100, };
+ ulint offsets_[100];
ulint* offsets = offsets_;
+ *offsets_ = (sizeof offsets_) / sizeof *offsets_;
*n_rows = 0;
diff --git a/innobase/row/row0purge.c b/innobase/row/row0purge.c
index 8897a1a872f..659a13b42a9 100644
--- a/innobase/row/row0purge.c
+++ b/innobase/row/row0purge.c
@@ -101,7 +101,8 @@ row_purge_remove_clust_if_poss_low(
mtr_t mtr;
rec_t* rec;
mem_heap_t* heap = NULL;
- ulint offsets_[100] = { 100, };
+ ulint offsets_[100];
+ *offsets_ = (sizeof offsets_) / sizeof *offsets_;
index = dict_table_get_first_index(node->table);
diff --git a/innobase/row/row0row.c b/innobase/row/row0row.c
index 438e54757cd..4f080c22af3 100644
--- a/innobase/row/row0row.c
+++ b/innobase/row/row0row.c
@@ -203,7 +203,8 @@ row_build(
byte* buf;
ulint i;
mem_heap_t* tmp_heap = NULL;
- ulint offsets_[100] = { 100, };
+ ulint offsets_[100];
+ *offsets_ = (sizeof offsets_) / sizeof *offsets_;
ut_ad(index && rec && heap);
ut_ad(index->type & DICT_CLUSTERED);
@@ -296,8 +297,9 @@ row_rec_to_index_entry(
ulint rec_len;
byte* buf;
mem_heap_t* tmp_heap = NULL;
- ulint offsets_[100] = { 100, };
+ ulint offsets_[100];
ulint* offsets = offsets_;
+ *offsets_ = (sizeof offsets_) / sizeof *offsets_;
ut_ad(rec && heap && index);
@@ -377,8 +379,9 @@ row_build_row_ref(
ulint clust_col_prefix_len;
ulint i;
mem_heap_t* tmp_heap = NULL;
- ulint offsets_[100] = { 100, };
+ ulint offsets_[100];
ulint* offsets = offsets_;
+ *offsets_ = (sizeof offsets_) / sizeof *offsets_;
ut_ad(index && rec && heap);
@@ -470,8 +473,9 @@ row_build_row_ref_in_tuple(
ulint clust_col_prefix_len;
ulint i;
mem_heap_t* heap = NULL;
- ulint offsets_[100] = { 100, };
+ ulint offsets_[100];
ulint* offsets = offsets_;
+ *offsets_ = (sizeof offsets_) / sizeof *offsets_;
ut_a(ref && index && rec);
diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c
index 7a5e4cb9264..16e2dc69e0b 100644
--- a/innobase/row/row0sel.c
+++ b/innobase/row/row0sel.c
@@ -79,14 +79,15 @@ row_sel_sec_rec_is_for_clust_rec(
ulint i;
dtype_t* cur_type;
mem_heap_t* heap = NULL;
- ulint clust_offsets_[100]
- = { 100, };
- ulint sec_offsets_[10]
- = { 10, };
+ ulint clust_offsets_[100];
+ ulint sec_offsets_[10];
ulint* clust_offs = clust_offsets_;
ulint* sec_offs = sec_offsets_;
ibool is_equal = TRUE;
+ *clust_offsets_ = (sizeof clust_offsets_) / sizeof *clust_offsets_;
+ *sec_offsets_ = (sizeof sec_offsets_) / sizeof *sec_offsets_;
+
clust_offs = rec_get_offsets(clust_rec, clust_index, clust_offs,
ULINT_UNDEFINED, &heap);
sec_offs = rec_get_offsets(sec_rec, sec_index, sec_offs,
@@ -625,8 +626,9 @@ row_sel_get_clust_rec(
rec_t* old_vers;
ulint err;
mem_heap_t* heap = NULL;
- ulint offsets_[100] = { 100, };
+ ulint offsets_[100];
ulint* offsets = offsets_;
+ *offsets_ = (sizeof offsets_) / sizeof *offsets_;
offsets = rec_get_offsets(rec,
btr_pcur_get_btr_cur(&plan->pcur)->index,
@@ -990,9 +992,10 @@ row_sel_try_search_shortcut(
dict_index_t* index;
rec_t* rec;
mem_heap_t* heap = NULL;
- ulint offsets_[100] = { 100, };
+ ulint offsets_[100];
ulint* offsets = offsets_;
ulint ret;
+ *offsets_ = (sizeof offsets_) / sizeof *offsets_;
index = plan->index;
@@ -1115,8 +1118,9 @@ row_sel(
ulint found_flag;
ulint err;
mem_heap_t* heap = NULL;
- ulint offsets_[100] = { 100, };
+ ulint offsets_[100];
ulint* offsets = offsets_;
+ *offsets_ = (sizeof offsets_) / sizeof *offsets_;
ut_ad(thr->run_node == node);
@@ -3035,9 +3039,10 @@ row_search_for_mysql(
ulint next_offs;
mtr_t mtr;
mem_heap_t* heap = NULL;
- ulint offsets_[100] = { 100, };
+ ulint offsets_[100];
ulint* offsets = offsets_;
-
+ *offsets_ = (sizeof offsets_) / sizeof *offsets_;
+
ut_ad(index && pcur && search_tuple);
ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
diff --git a/innobase/row/row0undo.c b/innobase/row/row0undo.c
index d994eab9873..895303e361c 100644
--- a/innobase/row/row0undo.c
+++ b/innobase/row/row0undo.c
@@ -152,8 +152,9 @@ row_undo_search_clust_to_pcur(
ibool ret;
rec_t* rec;
mem_heap_t* heap = NULL;
- ulint offsets_[100] = { 100, };
+ ulint offsets_[100];
ulint* offsets = offsets_;
+ *offsets_ = (sizeof offsets_) / sizeof *offsets_;
mtr_start(&mtr);
diff --git a/innobase/row/row0upd.c b/innobase/row/row0upd.c
index 173912d6956..d04e3c3aef1 100644
--- a/innobase/row/row0upd.c
+++ b/innobase/row/row0upd.c
@@ -706,8 +706,9 @@ row_upd_build_sec_rec_difference_binary(
upd_t* update;
ulint n_diff;
ulint i;
- ulint offsets_[10] = { 10, };
+ ulint offsets_[10];
const ulint* offsets;
+ *offsets_ = (sizeof offsets_) / sizeof *offsets_;
/* This function is used only for a secondary index */
ut_a(0 == (index->type & DICT_CLUSTERED));
@@ -783,8 +784,9 @@ row_upd_build_difference_binary(
ulint trx_id_pos;
ibool extern_bit;
ulint i;
- ulint offsets_[100] = { 100, };
+ ulint offsets_[100];
const ulint* offsets;
+ *offsets_ = (sizeof offsets_) / sizeof *offsets_;
/* This function is used only for a clustered index */
ut_a(index->type & DICT_CLUSTERED);
@@ -1193,8 +1195,9 @@ row_upd_store_row(
upd_t* update;
rec_t* rec;
mem_heap_t* heap = NULL;
- ulint offsets_[100] = { 100, };
+ ulint offsets_[100];
const ulint* offsets;
+ *offsets_ = (sizeof offsets_) / sizeof *offsets_;
ut_ad(node->pcur->latch_mode != BTR_NO_LATCHES);
@@ -1393,7 +1396,8 @@ row_upd_clust_rec_by_insert(
btr_cur = btr_pcur_get_btr_cur(pcur);
if (node->state != UPD_NODE_INSERT_CLUSTERED) {
- ulint offsets_[100] = { 100, };
+ ulint offsets_[100];
+ *offsets_ = (sizeof offsets_) / sizeof *offsets_;
err = btr_cur_del_mark_set_clust_rec(BTR_NO_LOCKING_FLAG,
btr_cur, TRUE, thr, mtr);
@@ -1533,8 +1537,10 @@ row_upd_clust_rec(
if (err == DB_SUCCESS && big_rec) {
mem_heap_t* heap = NULL;
- ulint offsets_[100] = { 100, };
+ ulint offsets_[100];
rec_t* rec;
+ *offsets_ = (sizeof offsets_) / sizeof *offsets_;
+
mtr_start(mtr);
ut_a(btr_pcur_restore_position(BTR_MODIFY_TREE, pcur, mtr));
@@ -1631,8 +1637,9 @@ row_upd_clust_step(
mtr_t mtr_buf;
rec_t* rec;
mem_heap_t* heap = NULL;
- ulint offsets_[100] = { 100, };
+ ulint offsets_[100];
const ulint* offsets;
+ *offsets_ = (sizeof offsets_) / sizeof *offsets_;
index = dict_table_get_first_index(node->table);
@@ -1988,7 +1995,8 @@ row_upd_in_place_in_select(
btr_cur_t* btr_cur;
ulint err;
mem_heap_t* heap = NULL;
- ulint offsets_[100] = { 100, };
+ ulint offsets_[100];
+ *offsets_ = (sizeof offsets_) / sizeof *offsets_;
ut_ad(sel_node->select_will_do_update);
ut_ad(sel_node->latch_mode == BTR_MODIFY_LEAF);