diff options
author | Sergey Vojtovich <svoj@mariadb.org> | 2015-04-17 14:30:15 +0400 |
---|---|---|
committer | Sergey Vojtovich <svoj@mariadb.org> | 2015-05-13 10:43:14 +0400 |
commit | 4d1ccc42890029e07048772579af97072e0fa3d5 (patch) | |
tree | 38fcd49963a7fe185636a0e4045edb6e700a6dca /sql/sql_delete.cc | |
parent | c4d2c4e844717d9d5b2c0e4f0f9cfc7cc2c24fa6 (diff) | |
download | mariadb-git-4d1ccc42890029e07048772579af97072e0fa3d5.tar.gz |
MDEV-7951 - sql_alloc() takes 0.25% in OLTP RO
sql_alloc() has additional costs compared to direct mem_root allocation:
- function call: it is defined in a separate translation unit and can't be
inlined
- it needs to call pthread_getspecific() to get THD::mem_root
It is called dozens of times implicitely at least by:
- List<>::push_back()
- List<>::push_front()
- new (for Sql_alloc derived classes)
- sql_memdup()
Replaced lots of implicit sql_alloc() calls with direct mem_root allocation,
passing through THD pointer whenever it is needed.
Number of sql_alloc() calls reduced 345 -> 41 per OLTP RO transaction.
pthread_getspecific() overhead dropped 0.76 -> 0.59
sql_alloc() overhed dropped 0.25 -> 0.06
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r-- | sql/sql_delete.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index b72f552441b..fa647679e23 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -496,7 +496,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, Filesort_tracker *fs_tracker= thd->lex->explain->get_upd_del_plan()->filesort_tracker; - if (!(sortorder= make_unireg_sortorder(order, &length, NULL)) || + if (!(sortorder= make_unireg_sortorder(thd, order, &length, NULL)) || (table->sort.found_records= filesort(thd, table, sortorder, length, select, HA_POS_ERROR, true, |