Browse StackOverflow today to find an interesting question:
Which is more preferable as performance wise and without error cause to delete all the row from table in SQLite in Androi D.
DELETE QUERY OR DROP TABLE and re-generate the table?
And about deleting all the data in SQLite, with drop and rebuild than delete all SQLite inside the data more effective rate
ItIsMore efficientTo Drop Table andRe-create it; andYes,You canUse "IF EXISTS" InchThisCaseDELETE Fromwould cause SQLiteToVisit individualRowsunless those rows has triggers, so it's generally reasonably efficient. Edited after 1 answer post as the droping the table using drop table Query then internally Delete query is used? As in one answer post
"When the WHERE was omitted from a DELETE statement and the table being deleted have no triggers, SQLite uses an optimizatio N to erase the entire table content without have to visit each row of the table individually. This "truncate" optimization makes the delete run much faster. Prior to SQLite version 3.6.5, the truncate optimization also meant, the Sqlite3_changes () and Sqlite3_total_changes () Interfaces and the count_changes pragma would not actually return the number of deleted rows. That problem has been fixed as of version 3.6.5. "
When ignoring from the DELETE statement, the table is deleted without triggering, and SQLite uses an optimization to delete the entire table content without having to access each row of the table separately. This "truncation" optimization makes the deletion run faster. Prior to the 3.6.5 SQLite version, truncation optimizations also meant that the sqlite3_changes () and Sqlite3_total_changes () interfaces and count_changes compilation instructions did not actually return the number of deleted rows. This issue has been fixed in version 3.6.5. ”
SQLite it says: The default build, if a DELETE statement does not have a WHERE clause and the operation of a table without triggering, causes the deletion to occur when the optimization is deleted and the table is recreated. Deleting and recreating a table is usually much higher than the content of a row-wise delete table. This is "truncated optimization"
That is, delete has read a row to delete a row, the drop after the creation of significantly higher efficiency
About Sqlitedrop database rebuild is more efficient than delete mode to empty the database