0
如果我使用delete從表中刪除數據,那麼select查詢的性能是否會下降?如果使用truncate清除整個表,並刪除所選行,是否會有性能差異?關於select的性能:post刪除或截斷表?
如果我使用delete從表中刪除數據,那麼select查詢的性能是否會下降?如果使用truncate清除整個表,並刪除所選行,是否會有性能差異?關於select的性能:post刪除或截斷表?
http://dev.mysql.com/doc/refman/5.1/en/truncate-table.html
Truncate operations drop and re-create the table, which is much faster than deleting rows one by one, particularly for large tables.
也:http://www.softstuff-consulting.com/kbase/showkb.asp?id=15
如果有引用該表中沒有外鍵,那麼這個表被刪除/即時重建。請參閱http://dev.mysql.com/doc/refman/5.0/en/truncate-table.html –