Chris Nizzardini, Salt Lake City Utah, Web Developer Specializing in LAMP+Ajax Since 2006

My Blog

Here is my awesome blog.

mysql temporary tables

Temporary tables exist in memory and are great if you just want to create a quick data store for the life of your current database connection. MySQL will purge the temporary table from memory at the end of the database connection. For a temporary table that persists and can be used by multiple connections you will need to create a Heap table.

1
2
3
CREATE TEMPORARY TABLE cancelledOrders
			ENGINE=MEMORY 
SELECT * FROM my_table

More information on temporary and heap tables

Leave a Reply