From fc570243cf717ca0bd2bca2963ecdf99e402b212 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Thu, 20 Nov 2008 19:16:20 +0400 Subject: [PATCH] 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 --- storage/myisam/ha_myisam.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index b8d5a9af8d2..3d0ebd3e04a 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -1789,6 +1789,8 @@ int ha_myisam::extra(enum ha_extra_function operation) { 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); }