MySQL Massive data removal

Source: Internet
Author: User
Tags mysql delete



Baidu know-MySQL delete massive data MySQL database delete the optimization of large quantities of data see here, and finally look at this article, for the operation of massive data SQL deep analysis cnblogs-depth analysis drop,truncate and delete difference " My Database Road Series "DZH Project massive data Delete actual combat, read the above article, consider truncate can only delete data, the table is not deleted, I used a drop Need to remove the rest of the table except the Dzh_weibo_cache Dzh_weibo_cache--2000wdzh_weibo_cache111--1500wDzh_weibo_cache2--400wDzh_weibo_cache3--700wAs a result of the following operations, drop is convenient and fast for deleting massive data tables mysql> show tables;
+---------------------------+
| Tables_in_dzh_crawl_weibo |
+---------------------------+
| Dzh_weibo_cache |
| dzh_weibo_cache111 |
| Dzh_weibo_cache2 |
| Dzh_weibo_cache3 |
+---------------------------+
4 rows in Set (0.00 sec)

mysql> DROP TABLE dzh_weibo_cache2;
Query OK, 0 rows affected (8.50 sec)

Mysql> Show tables;
+---------------------------+
| Tables_in_dzh_crawl_weibo |
+---------------------------+
| Dzh_weibo_cache |
| dzh_weibo_cache111 |
| Dzh_weibo_cache3 |
+---------------------------+
3 Rows in Set (0.00 sec)

mysql> DROP TABLE Dzh_weibo_cache3;
Query OK, 0 rows affected (10.85 sec)

Mysql> Show tables;
+---------------------------+
| Tables_in_dzh_crawl_weibo |
+---------------------------+
| Dzh_weibo_cache |
| dzh_weibo_cache111 |
+---------------------------+
2 rows in Set (0.00 sec)

mysql> DROP TABLE dzh_weibo_cache111;
Query OK, 0 rows affected (18.84 sec)

MySQL Massive data removal

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.