max_heap_table_size เป็นตัวแปรระบบ (system variable) ที่อ่าน/เขียนได้ ค่าเริ่มต้นคือ 16 MB
ตรวจสอบค่าปัจจุบัน
mysql> select @@max_heap_table_size;
+-----------------------+ | @@max_heap_table_size | +-----------------------+ | 16777216 | +-----------------------+
การแปลง: 16777216 bytes = 16 MB (16777216 / 1024 / 1024 = 16)
เปลี่ยนค่าเป็น 32 MB
mysql> set @@max_heap_table_size = 33554432; Query OK, 0 rows affected (0.00 sec)
ตรวจสอบอีกครั้ง:
mysql> select @@max_heap_table_size;
+-----------------------+ | @@max_heap_table_size | +-----------------------+ | 33554432 | +-----------------------+
ยืนยันเป็น 32 MB:
mysql> select @@max_heap_table_size / 1048576 as MB;
+---------+ | MB | +---------+ | 32.0000 | +---------+
หมายเหตุ: ค่าต้องระบุเป็นไบต์ (bytes) การเปลี่ยนค่านี้มีผลต่อตาราง MEMORY และการสร้างตารางชั่วคราวภายใน