diff options
author | Michael Widenius <monty@askmonty.org> | 2012-03-23 18:22:39 +0200 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2012-03-23 18:22:39 +0200 |
commit | c36bdf1c889539413d5369ae628aff97d044b276 (patch) | |
tree | d53d59e615088a42a15e4eaae85b20acf6e2fe2a /sql/sql_base.cc | |
parent | 8e825a2249440e7df0fce0123f6d543b09b29194 (diff) | |
download | mariadb-git-c36bdf1c889539413d5369ae628aff97d044b276.tar.gz |
Speedup:
- Don't call update_virtual_fields() if table->vfield is not set
- Don't prealloc memory for in open_tables() as this is very seldom used.
sql/records.cc:
Don't call update_virtual_fields() if table->vfield is not set
sql/sql_base.cc:
Don't prealloc memory for in open_tables() as this is very seldom used.
Don't call update_virtual_fields() if table->vfield is not set
sql/sql_delete.cc:
Don't call update_virtual_fields() if table->vfield is not set
sql/sql_handler.cc:
Don't call update_virtual_fields() if table->vfield is not set
sql/sql_join_cache.cc:
Don't call update_virtual_fields() if table->vfield is not set
Move some frequent values to local variables
sql/sql_table.cc:
Don't call update_virtual_fields() if table->vfield is not set
sql/sql_update.cc:
Don't call update_virtual_fields() if table->vfield is not set
sql/table.cc:
Assert if update_virtual_fields is called with wrong parameters
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r-- | sql/sql_base.cc | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 19fabd27d72..03d8a925fc2 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -4706,7 +4706,7 @@ int open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags) temporary mem_root for new .frm parsing. TODO: variables for size */ - init_sql_alloc(&new_frm_mem, 8024, 8024); + init_sql_alloc(&new_frm_mem, 8024, 0); thd->current_tablenr= 0; restart: @@ -8648,14 +8648,9 @@ fill_record(THD * thd, List<Item> &fields, List<Item> &values, } /* Update virtual fields*/ thd->abort_on_warning= FALSE; - if (vcol_table) - { - if (vcol_table->vfield) - { - if (update_virtual_fields(thd, vcol_table, TRUE)) - goto err; - } - } + if (vcol_table && vcol_table->vfield && + update_virtual_fields(thd, vcol_table, TRUE)) + goto err; thd->abort_on_warning= save_abort_on_warning; thd->no_errors= save_no_errors; DBUG_RETURN(thd->is_error()); |