MDEV-32145 Disable read-ahead for temporary tablespace

- Lifetime of temporary tables is expected to be short, it would
seem to make sense to assume that all temporary tablespace pages
will remain in the buffer pool. It doesn't make sense to have
read-ahead for pages of temporary tablespace
parent cdd2fa7f
...@@ -357,7 +357,8 @@ TRANSACTIONAL_TARGET ...@@ -357,7 +357,8 @@ TRANSACTIONAL_TARGET
ulint ulint
buf_read_ahead_random(const page_id_t page_id, ulint zip_size, bool ibuf) buf_read_ahead_random(const page_id_t page_id, ulint zip_size, bool ibuf)
{ {
if (!srv_random_read_ahead) if (!srv_random_read_ahead || page_id.space() >= SRV_TMP_SPACE_ID)
/* Disable the read-ahead for temporary tablespace */
return 0; return 0;
if (srv_startup_is_before_trx_rollback_phase) if (srv_startup_is_before_trx_rollback_phase)
...@@ -514,8 +515,9 @@ TRANSACTIONAL_TARGET ...@@ -514,8 +515,9 @@ TRANSACTIONAL_TARGET
ulint ulint
buf_read_ahead_linear(const page_id_t page_id, ulint zip_size, bool ibuf) buf_read_ahead_linear(const page_id_t page_id, ulint zip_size, bool ibuf)
{ {
/* check if readahead is disabled */ /* check if readahead is disabled.
if (!srv_read_ahead_threshold) Disable the read ahead logic for temporary tablespace */
if (!srv_read_ahead_threshold || page_id.space() >= SRV_TMP_SPACE_ID)
return 0; return 0;
if (srv_startup_is_before_trx_rollback_phase) if (srv_startup_is_before_trx_rollback_phase)
......
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