I heard like deleting all rows before dropping table will improve performance. I looked into Web, but couldn't find any reliable answers. Please share whether this is true and the reason behind. Also is the overall performance i.e, ( delete all rows + drop empty table ) is better than dropping table with all rows ?
TRUNCATEwhich has better performance on deleting all rows of a table thanDELETEas it does not count how many rows are deleted (whereasDELETEdoes). So if you want to empty a table, use the following for better performanceTRUNCATE <table>, you can also check mysqltutorial.org/mysql-delete-statement.aspxDELETEcan be rolled back in InnoDB aDROPtable cant so there is less overhead for WAL or better said no WAL is used withDROPas in MySQLDROPis simply more or less directly mapped to the OS delete dir or file functions.. (comment is oversimplified) .. But it is wierd why you would delete all records before dropping the table..DROPaswell but not totally sure how it is implemented there it might work internally might be as simple as a dir or file rename on disk. ..