#At file:///home/hf/work/mysql_common/40634/
2722 Alexey Botchkov 2008-11-20
Bug#40634 table scan temporary table is 4x slower due to mmap instead instead of caching
mmap is slower that caching indeed.
Here the problem is that mmap is used even if --myisam-use-mmap=OFF
solved by checking the flag in ha_myisam::extra() as it is called in
init_read_record()
per-file comments:
storage/myisam/ha_myisam.cc
Bug#40634 table scan temporary table is 4x slower due to mmap instead instead of caching
do nothing for HA_EXTRA_MMAP if no opt_myisam_use_mmap
modified:
storage/myisam/ha_myisam.cc
=== modified file 'storage/myisam/ha_myisam.cc'
--- a/storage/myisam/ha_myisam.cc 2008-03-28 10:14:27 +0000
+++ b/storage/myisam/ha_myisam.cc 2008-11-20 15:16:20 +0000
@@ -1789,6 +1789,8 @@ int ha_myisam::extra(enum ha_extra_funct
{
if ((specialflag & SPECIAL_SAFE_MODE) && operation == HA_EXTRA_KEYREAD)
return 0;
+ if (operation == HA_EXTRA_MMAP && !opt_myisam_use_mmap)
+ return 0;
return mi_extra(file, operation, 0);
}