MySQL Temporary Table vs Memory Table.

In a previous post, I discussed Memory Storage Engine of MySQL.
After discussing on this topic, there is one confusion.

What is the difference between Temporary Table and Memory Table?

The main difference is, Temporary Table is only for running current session. Once running session completed its execution than Temporary Table will be discarded. You cannot use Temporary Table for multiple sessions.
As we previously discussed, that Memory Table can hold data for across all running sessions and connections.

Temporary Table stores all data and table definition in temporary disk file.
Memory Table stores all data into Memory and stores table definition into .frm disk file.

Temporary Table can also store all data into memory ,but for that you have to create a Temporary Table using Memory Engine.

Anvesh Patel

Leave a Reply

Be the First to Comment!

Notify of