SQlite, Android, true story. I have a table, which I use as a cache:
CREATE TABLE cache(key TEXT, ts TIMESTAMP, size INTEGER, data BLOB);
CREATE UNIQUE INDEX
You have two options to improve the performance, especially the first one:
1) Using Transaction like this:
DbTransaction trans = conn.BeginTransaction(); // <-------------------
try
{
Any code to delete the items
}
catch
{
trans.Rollback(); // <-------------------
throw; // <-------------------
}
2) Otherwise, supposing that the items are continuous, then
a) Get the ID of the first item;
b) Get the total number of items to be deleted
c) Using command like this:
DELETE FROM blobs WHERE ID > fistId LIMIT count;
Good luck.