Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6638731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:28:14+00:00 2026-05-25T23:28:14+00:00

In MySQL , when you create a temporary table, for example, CREATE TEMPORARY TABLE

  • 0

In MySQL, when you create a temporary table, for example, CREATE TEMPORARY TABLE ..., is that table created and held in memory or on the disk?

I have read through the docs and Google’d it and have not come up with an answer.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T23:28:15+00:00Added an answer on May 25, 2026 at 11:28 pm

    It depends on what engine you specify. By default the table data will be stored on disk. If you specify the MEMORY engine, the data will only be stored in memory.

    It should be possible to actually find the files that are created in the filesystem when the temporary tables are created. After running the following commands:

    CREATE TABLE test.table_myisam (x int) ENGINE=MyISAM;
    CREATE TABLE test.table_memory (x int) ENGINE=MEMORY;
    CREATE TEMPORARY TABLE test.temp_table_myisam (x int) ENGINE=MyISAM;
    CREATE TEMPORARY TABLE test.temp_table_memory (x int) ENGINE=MEMORY;
    

    I then checked the directory: C:\ProgramData\MySQL\MySQL Server 5.5\data\test (on Windows) and the files present were:

    table_innodb.frm   # Table definition.
    table_innodb.MYD   # MyISAM table data file.
    table_innodb.MYI   # MyISAM table index file.
    
    table_memory.frm   # No MYD or MYI file for the MEMORY engine.
    

    The temporary tables are stored in C:\Windows\Temp and have unusual names, but internally the data is stored in the same way.

    #sql9a0_7_d.frm    # This is the MyISAM temporary table.
    #sql9a0_7_d.MYD    # MyISAM data file for temporary table.
    #sql9a0_7_d.MYI    # MyISAM index file for temporary table.
    
    #sql9a0_7_c.frm    # This is the MEMORY engine file. No MYD or MYI.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a MySQL stored procedure that uses a temporary table. Assume that my
I have created a sql function in SQLServer 2008 that declared a temporary table
I have a members table in MySQL CREATE TABLE `members` ( `id` int(10) unsigned
Lets say I have the following MySQL structure: CREATE TABLE `domains` ( `id` INT(10)
I am attempting to create a MySQL snippet that will analyse a table and
I saw the solution to create an alternate temporary MySQL table with unique rows,
Is there a way to create a dump/export/save a temporary MySQL table into a
My call sequence to MySQL is like this: Connection1: create temporary table 'temp_table'... Connection2:
Ok I have a temporary MySQL table with 135,000 rows, from this temporary table
I'm running a MySQL Query, here it is: CREATE TEMPORARY TABLE LeaderBoard ( `agent_name`

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.