• Tatiana A. Nurnberg's avatar
    Bug#32149: Long semaphore wait for adaptive hash latch · e34085fe
    Tatiana A. Nurnberg authored
    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")
    e34085fe
sql_select.cc 504 KB