Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the temporary watches of mysql?

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "what are the temporary watches of mysql". In the daily operation, I believe many people have doubts about the temporary tables of mysql. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the questions of "what kinds of temporary tables of mysql?" Next, please follow the editor to study!

There are two types of mysql temporary tables, one is created using create temporary table, which is called external temporary table (in the case not explained in this article, temporary table defaults to external temporary table), and the other is generated by union, order by, group by, distinct and other statements, which is called internal temporary table.

1. Create temporary table syntax create temporary table table_name (column1 type,column1 type,...columnX type)

2. The temporary table is only visible to the current user. When the current session ends, the temporary table will be deleted automatically. Unlike oracle, oracle only deletes data, and the table structure of temporary table exists forever.

3. Within a session, a temporary table can be named with the same name as a non-temporary table. Once a temporary table with the same name appears in a session, the non-temporary table is not visible to the current session, and any operation is performed on the temporary table (show create table table_name, dml, ddl) until the temporary table is deleted.

4. The show tables command does not display temporary tables

5. Different sessions can create temporary tables with the same name. For example, session A can create a temporary table name temp1, and session B can also create a temporary table name temp1.

6. The table structure of the temporary table is stored in the directory corresponding to the tmpdir parameter, named # sqlc process number _ thread number _ sequence number .frm. For example, # sqlc19_7_0.frm and # sqlc19_7_1.frm represent the first temporary table and the second temporary table under thread 7, respectively.

At this point, the study of "what are the temporary tables of mysql" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report