Commit 91511216 authored by Sergey Vojtovich's avatar Sergey Vojtovich

Scalability bottleneck in ha_innodb::general_fetch

With "WL#6047 - Do not allocate trx id for read-only transactions"
m_prebuilt->trx->id is always 0 for read-only transactions. This makes
it useless as an index for fuzzy counters.

Use server thread id instead similarly to MySQL.
parent b002509b
......@@ -10453,10 +10453,10 @@ ha_innobase::index_read(
table->status = 0;
if (m_prebuilt->table->is_system_db) {
srv_stats.n_system_rows_read.add(
(size_t) m_prebuilt->trx->id, 1);
thd_get_thread_id(m_prebuilt->trx->mysql_thd), 1);
} else {
srv_stats.n_rows_read.add(
(size_t) m_prebuilt->trx->id, 1);
thd_get_thread_id(m_prebuilt->trx->mysql_thd), 1);
}
break;
......@@ -10778,10 +10778,10 @@ ha_innobase::general_fetch(
table->status = 0;
if (m_prebuilt->table->is_system_db) {
srv_stats.n_system_rows_read.add(
(size_t) m_prebuilt->trx->id, 1);
thd_get_thread_id(trx->mysql_thd), 1);
} else {
srv_stats.n_rows_read.add(
(size_t) m_prebuilt->trx->id, 1);
thd_get_thread_id(trx->mysql_thd), 1);
}
break;
case DB_RECORD_NOT_FOUND:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment