summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2020-06-26 13:42:04 +0300
committerMonty <monty@mariadb.org>2020-07-02 14:25:41 +0300
commit3f2044ae99633ce6d9c756bb6b045efc0707b4b5 (patch)
tree63ed49261c9cf3015aa2ca45813899ad500b959e
parent1df1a6392477ad211b2a66c6eccbe9d5c6316c7e (diff)
downloadmariadb-git-3f2044ae99633ce6d9c756bb6b045efc0707b4b5.tar.gz
MDEV-22535 TABLE::initialize_quick_structures() takes 0.5% in oltp_read_only
- Removed not needed bzero in void TABLE::initialize_quick_structures(). - Replaced bzero with TRASH_ALLOC() to have this change verfied with memory checkers - Added missing table->quick_keys.is_set in table_cond_selectivity()
-rw-r--r--sql/sql_select.cc2
-rw-r--r--sql/table.cc8
2 files changed, 5 insertions, 5 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index e7f593326a4..1738cf5d18f 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -8573,7 +8573,7 @@ double table_cond_selectivity(JOIN *join, uint idx, JOIN_TAB *s,
/*
Check if we have a prefix of key=const that matches a quick select.
*/
- if (!is_hash_join_key_no(key))
+ if (!is_hash_join_key_no(key) && table->quick_keys.is_set(key))
{
key_part_map quick_key_map= (key_part_map(1) << table->quick_key_parts[key]) - 1;
if (table->quick_rows[key] &&
diff --git a/sql/table.cc b/sql/table.cc
index 1877c3b7c76..c0cfc5ca3db 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -9358,10 +9358,10 @@ bool TABLE::export_structure(THD *thd, Row_definition_list *defs)
void TABLE::initialize_quick_structures()
{
- bzero(quick_rows, sizeof(quick_rows));
- bzero(quick_key_parts, sizeof(quick_key_parts));
- bzero(quick_costs, sizeof(quick_costs));
- bzero(quick_n_ranges, sizeof(quick_n_ranges));
+ TRASH_ALLOC(quick_rows, sizeof(quick_rows));
+ TRASH_ALLOC(quick_key_parts, sizeof(quick_key_parts));
+ TRASH_ALLOC(quick_costs, sizeof(quick_costs));
+ TRASH_ALLOC(quick_n_ranges, sizeof(quick_n_ranges));
}
/*