In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces what is the use of TRUNCATE AND Deleted in mysql. It has certain reference value. Interested friends can refer to it. I hope you will have a lot of gains after reading this article. Let Xiaobian take you to understand it together.
TRUNCATE TABLE and Delete without WHERE function is the same, are to delete all the data in the table, but TRUNCATE TABLE faster, occupy less log, this is because TRUNCATE TABLE directly releases the data page and only records the release of the data page in the transaction log, and Delete is a line by line deletion, in the transaction log to record the deletion of each record.
Can you replace Delete without WHERE with TRUNCATE TABLE? This is not possible in the following cases:
1. TRUNCATE TABLE cannot be used when the identity is to be retained, because TRUNCATE TABLE resets the identity.
2. TRUNCATE TABLE cannot be used when triggers are needed, it will not fire triggers.
TRUNCATE TABLE cannot be used for tables referenced by FOREIGN KEY constraints (i.e., tables with primary keys, not tables with foreign keys).
TRUNCATE TABLE cannot be used for tables that participate in indexed views. Note that TRUNCATE TABLE refers to indexed views, not ordinary views.
Thank you for reading this article carefully. I hope that the article "TRUNCATE AND Deleted in mysql" shared by Xiaobian will be helpful to everyone. At the same time, I hope that everyone will support you a lot and pay attention to the industry information channel. More relevant knowledge is waiting for you to learn!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.