I am not an expert for Sqlite, but overall there are 3 ways to do this.
- As each authority commented on Truncate, if you intend to delete the entire entry.
- If you switch to most of the records, you can store the files without deleting in tempTable , and then trim your actual table, at the end insert all records from temp to the actual table
This is what I use most of the time. Use the Top XXX delete operator in your case, you can delete 200 entries in every 2 minutes. (I assume that you do not enter more than 200 entries in 2 minutes). AsyncTask is the way to go. In T-SQL, I use the following sql, it is up to you.
Remove from tUser where UserId in (Select the top 200 UserId From tUser where LastLoggin <GetDate () - 120)
source share