mysql 海量資料刪除

來源:互聯網
上載者:User

標籤:style   blog   http   io   color   ar   sp   資料   div   



百度知道 - mysql刪除海量資料 MySQL 資料庫刪除大批量資料的最佳化  看到這兒的話,最後看下這篇文章,對於操作海量資料的sql深入分析cnblogs - 深度分析DROP,TRUNCATE與DELETE的區別【我的資料庫之路系列】 dzh項目海量資料刪除實戰,看了上面文章,考慮truncate只能刪除資料,表沒有刪掉,我就用了drop 需求,除了dzh_weibo_cache表其餘的都要刪除dzh_weibo_cache --2000wdzh_weibo_cache111 --1500wdzh_weibo_cache2 --400wdzh_weibo_cache3 --700w 下面數操作後的結果,drop對於刪除海量資料表方便又快 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 海量資料刪除

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.