On Wed, Jan 4, 2012 at 6:52 AM, Tarun <er.tarun.9...@gmail.com> wrote:

> Hi All,
>
> I am running program in which I have created SQLite DB file using:
> sqlite3_open_v2()
>
> configured it:
>
> PRAGMA journal_mode = WAL
> PRAGMA synchronous=OFF
>
> Then created one table into SQLiteDB by using sqlite3_exec() in which
> I passed SQL command of creating table.
>
> After configuration, SQLite file size =  1024bytes
>
> Then I inserted 500 records into table using INSERT sql command in
> sqlite3_exec()
> SQLite file size =  69632
>
> Then I did deletion of all 500 records from table using DELETE sql query in
> sqlite3_exec()
> SQLite file size =  113664
>
> I don't know why file size is increased on deletion ??


The size of the database file is not representative of the amount of
content in the file while there is an active write-ahead log.  Run "PRAGMA
wal_checkpoint;" after doing your inserts and/or after running VACUUM to
get the true database size.





>
> Then I ran VACUUM command.
>
> SQLite file size remained  113664, it did not get reduced.
>
> But when I closed my application working on SQLite DB file, file size
> is reduced to 3072.
>
> I did not understand this behavior. I think as soon as I run VACUUM
> command, it should reduce file size at that moment.
> Please share correct behavior that should happen in this scenario shared
> above.
>
>
> Waiting for your response, I am stuck in my work.
>
>
> --
> Thanks and Regards,
> - Tarun Thakur
> Module Lead
> NEC HCL System Technologies, Noida
> www.nechclst.in
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to