summaryrefslogtreecommitdiff
path: root/sql/sql_update.cc
diff options
context:
space:
mode:
authorSergei Petrunia <psergey@askmonty.org>2015-04-07 01:29:17 +0300
committerSergei Petrunia <psergey@askmonty.org>2015-04-07 01:29:17 +0300
commit2af935c8ec238f57d4ed909a8876031bd36dbb4d (patch)
tree5e802608372b90a9e7c28941aab8a7507d607458 /sql/sql_update.cc
parent2936fb127d551a1abd6f30bdfd50a8a9bcf4e41b (diff)
downloadmariadb-git-2af935c8ec238f57d4ed909a8876031bd36dbb4d.tar.gz
MDEV-7899: 10.1 is 3% slower than 10.0 in OLTP RO
- Remove ANALYZE's timing code off the the execution path of regular SELECTs. - Improve the tracker that tracks counts/execution times of SELECTs or DML statements: = regular execution just increments counters = ANALYZE will also collect timings.
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r--sql/sql_update.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 680d3d7bd79..20a9a1fa915 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -517,7 +517,9 @@ int mysql_update(THD *thd,
*/
if (thd->lex->describe)
goto produce_explain_and_leave;
- query_plan.save_explain_data(thd->mem_root, thd->lex->explain);
+ explain= query_plan.save_explain_update_data(thd->mem_root, thd);
+
+ ANALYZE_START_TRACKING(&explain->command_tracker);
DBUG_EXECUTE_IF("show_explain_probe_update_exec_start",
dbug_serve_apcs(thd, 1););
@@ -721,7 +723,6 @@ int mysql_update(THD *thd,
if (table->file->ha_table_flags() & HA_PARTIAL_COLUMN_READ)
table->prepare_for_position();
- explain= thd->lex->explain->get_upd_del_plan();
table->reset_default_fields();
/*
@@ -731,7 +732,6 @@ int mysql_update(THD *thd,
*/
can_compare_record= records_are_comparable(table);
explain->tracker.on_scan_init();
- ANALYZE_START_TRACKING(&explain->time_tracker);
while (!(error=info.read_record(&info)) && !thd->killed)
{
@@ -908,7 +908,7 @@ int mysql_update(THD *thd,
break;
}
}
- ANALYZE_STOP_TRACKING(&explain->time_tracker);
+ ANALYZE_STOP_TRACKING(&explain->command_tracker);
table->auto_increment_field_not_null= FALSE;
dup_key_found= 0;
/*
@@ -1046,7 +1046,7 @@ produce_explain_and_leave:
We come here for various "degenerate" query plans: impossible WHERE,
no-partitions-used, impossible-range, etc.
*/
- query_plan.save_explain_data(thd->mem_root, thd->lex->explain);
+ query_plan.save_explain_update_data(thd->mem_root, thd);
emit_explain_and_leave:
int err2= thd->lex->explain->send_explain(thd);