I recently started noticing that a large sum of my tmp tables of my MySQL is being created on my Disk rather then in the memory.
TEMP TABLES Current max_heap_table_size = 128 M Current tmp_table_size = 128 M Of 73993 temp tables, 46% were created on disk Perhaps you should increase your tmp_table_size and/or max_heap_table_size to reduce the number of disk-based temporary tables Note! BLOB and TEXT columns are not allow in memory tables. If you are using these columns raising these values might not impact your ratio of on disk temp tables.
How can I optimize this so that it uses memory rather then the disk since it would be faster.