which was more preferable as performance wise and without error cause to delete all the row from table in sqlite in android.
DELETE QUERY OR DROP TABLE AND RE-GENERATE THE TABLE
I have found this from this post
it is more efficient to drop table and re-create it; and yes, You can use "IF EXISTS" in this case
DELETE FROM will cause SQLite to visit individual rows unless those rows have 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 was used? As in one answer post
As per the sqlite query I found the answer. In sqlite they have used the Truncation Optimization so when the "where" clause was omitted they drop the table and re-create the table this is much faster than delete all rows.
here is the links for that
http://www.sqlite.org/lang_delete.html
http://www.sqlite.org/compile.html#omit_truncate_optimization
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With