summaryrefslogtreecommitdiff
path: root/sql/ha_myisam.cc
diff options
context:
space:
mode:
authorTatiana A. Nurnberg <azundris@mysql.com>2009-06-05 00:23:08 +0200
committerTatiana A. Nurnberg <azundris@mysql.com>2009-06-05 00:23:08 +0200
commite34085fe13c7572ae355b456e5d9eb751bacdf7f (patch)
tree9e8782dc66d9c3f10913f9d3ceebb5a097301067 /sql/ha_myisam.cc
parent8041311e24441351fbb42b5ef99f9fd703fde5da (diff)
downloadmariadb-git-e34085fe13c7572ae355b456e5d9eb751bacdf7f.tar.gz
Bug#32149: Long semaphore wait for adaptive hash latch
Holding on to the temporary inno hash index latch is an optimization in many cases, but a pessimization in some others. Release temporary latches for those corner cases we (or rather, or customers, thanks!) have identified, that is, when we are about to do something that might take a really long time, like REPAIR or filesort. sql/ha_myisam.cc: Let go of (inno, for now) latch when doing MyISAM-repair. (optimize passes through repair.) ("Stuck" in "Repair with keycache".) sql/sql_insert.cc: Let go of (inno, for now) latch when doing CREATE...SELECT in select_insert::send_data() -- it might take a while. ("stuck" in "Sending data") sql/sql_select.cc: Release temporary (inno, for now) latch on - free_tmp_table() (this can take surprisingly long, "removing tmp table") - create_myisam_from_heap() (HEAP table overflowing onto disk as MyISAM, "converting HEAP to MyISAM")
Diffstat (limited to 'sql/ha_myisam.cc')
-rw-r--r--sql/ha_myisam.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc
index 95b7b338131..086b1209a7a 100644
--- a/sql/ha_myisam.cc
+++ b/sql/ha_myisam.cc
@@ -1009,6 +1009,9 @@ int ha_myisam::repair(THD *thd, MI_CHECK &param, bool do_optimize)
param.out_flag= 0;
strmov(fixed_name,file->filename);
+ // Release latches since this can take a long time
+ ha_release_temporary_latches(thd);
+
// Don't lock tables if we have used LOCK TABLE
if (!thd->locked_tables &&
mi_lock_database(file, table->s->tmp_table ? F_EXTRA_LCK : F_WRLCK))