Delete all data from the table:
DELETE from [Name]
When a large amount of data has been deleted in SQLite, the size of the database file remains the same. The reason: After deleting data from SQLite, unused disk space is added to an intrinsic "free list" to store the data you insert next. Disk space is not lost. However, it does not return disk space to the operating system.
There are two ways to solve the problem:
1, after the data is deleted, manually execute the SQL "VACUUM" command, the execution method is very simple. Recommended use.
2, set the auto_vacuum to "1" when the database file is built. The second method, however, has the disadvantage of truncating only the pages in the free list from the database file, without reclaiming the fragments in the database, or re-organizing the contents of the database like a vacuum command. In fact, Auto-vacuum will produce more fragmentation because of the need to move pages in the database file. Also, there is the. db-journal file that is generated when the delete operation is performed. To use auto-vacuum, you need some preconditions. The database needs to store some extra information to record each database page it tracks back to its pointer location. Therefore, the Auto-vacumm must be opened before the table is built. After a table is created, Auto-vacumm can no longer be turned on or off.
http://blog.csdn.net/libaineu2004/article/details/28433633
Fixed file size unchanged after SQLite deleted data (VACUUM)