Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
切り捨てテーブル table_name を使用しています。約 100 万行のテーブルで実行していますが、時間がかかりすぎて、最後の 3 時間から実行されています。
それは正常ですか?テーブルからすべての行を削除する他の方法を提案できますか?
次のような場合、切り捨ては機能しません。
インデックスのようなものといくつかの外部キー制約がある場合
私が提案する簡単な方法は
RENAME TABLE table_name TO t1; CREATE TABLE table_name LIKE t1; DROP TABLE t1;
または使用することもできますDELETE FROM table_name;
DELETE FROM table_name;