Commit 3f2044ae authored by Monty's avatar Monty

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()
parent 1df1a639
...@@ -8573,7 +8573,7 @@ double table_cond_selectivity(JOIN *join, uint idx, JOIN_TAB *s, ...@@ -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. 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; key_part_map quick_key_map= (key_part_map(1) << table->quick_key_parts[key]) - 1;
if (table->quick_rows[key] && if (table->quick_rows[key] &&
......
...@@ -9358,10 +9358,10 @@ bool TABLE::export_structure(THD *thd, Row_definition_list *defs) ...@@ -9358,10 +9358,10 @@ bool TABLE::export_structure(THD *thd, Row_definition_list *defs)
void TABLE::initialize_quick_structures() void TABLE::initialize_quick_structures()
{ {
bzero(quick_rows, sizeof(quick_rows)); TRASH_ALLOC(quick_rows, sizeof(quick_rows));
bzero(quick_key_parts, sizeof(quick_key_parts)); TRASH_ALLOC(quick_key_parts, sizeof(quick_key_parts));
bzero(quick_costs, sizeof(quick_costs)); TRASH_ALLOC(quick_costs, sizeof(quick_costs));
bzero(quick_n_ranges, sizeof(quick_n_ranges)); TRASH_ALLOC(quick_n_ranges, sizeof(quick_n_ranges));
} }
/* /*
......
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