wlad posted some flame graphs that show that ha_innobase::info_low() is spending time on waiting for a shared latch. It seems to me that the following is the culprit:
space->s_lock();
|
stats.delete_length = 1024
|
* fsp_get_available_space_in_free_extents(
|
*space);
|
space->s_unlock();
|
This is being executed on every call for HA_STATUS_VARIABLE, even though apparently only callers with HA_STATUS_VARIABLE_EXTRA are interested in the result. This would mainly be SHOW TABLES and get_schema_tables_record().
In the flame graph, the unnecessary latch acquisition occurs in mysql_update():
/* Update the table->file->stats.records number */
|
table->file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK);
|
set_statistics_for_table(thd, table);
|