Regarding Sqlite Memory Concern in Delete Operation
(1) By Mehul (mehuldave007) on 2022-10-05 06:58:44 [link] [source]
Hello Sir, we have concern regarding Sqlite Memory size.if sqlite table into delete any records using delete query in this case sqlite db into fully deleted or partially deleted? because of we are facing in sql database in delete after some references are not deleted and day by day memory size is increase.so kindly support for my concern for sqlite.
(2) By Chris Locke (chrisjlocke1) on 2022-10-05 16:23:02 in reply to 1 [source]
Memory size? Deleting records would have no effect on your application's memory size accessing a SQLite database.
If you mean file size, then deleting records has no effect on the size of a database file. There is a 'vacuum' command which removes blank portions of a database.
However, very much like a hard drive, SQLite re-uses free space. So if you add 100 MB of records, the database is 100 MB. If you delete 50 MB of records, the database is still 100 MB. However, if you add a further 50 MB of records, the database remains 100 MB - it would have re-used the empty 50 MB.
If you delete 50 MB of data and run the 'vacuum' command, the file-size will decrease by 50 MB.*
*Roughly. Only approximate example figures, obviously.