On 17 Dec 2017, at 10:01pm, Dinu <dinumar...@gmail.com> wrote:

> The CPU is capped up badly, the HDD
> is at idle level so this also hints to the same issue.

Apparently your program/OS is trying to do everything in cache.  This may be 
self-defeating for this operation.

Your description of what’s happening is reasonable, and suggests SQLite is 
working the way it should do.

> We have ~32M records out of which we are deleting about ~24M.

It might be faster to create a new table with the rows which survive, then 
delete the whole old table.

1) Rename old table.
2) CREATE new table.
3) Copy the rows which survive from the old table.  Depending on your selection 
criteria you might be able to use

INSERT INTO MyTable (SELECT FROM OldTable WHERE survive=1)

4) DROP OldTable
5) Create the indexes you need on MyTable

If you have FOREIGN KEYs it may be problematic to do this.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to