Topic: Compact a sql.db ?

Hello Dmitry

Is there a way to compact (and repair) a sql.db ?
With time and many operations on a table, it is perhaps a necessity to apply this function on sql.db
to remove all the empty spaces and to lose weight.

Something as Form1.dbPackTable (as for DBF table)

Thanks for your answer

JB

Re: Compact a sql.db ?

Hello,


Please use for that utility SQLite Studio, open database file (sqlite.db) then menu: Database > vacuum


But it does not necessarily, empty spaces in database will be used for new records.

Dmitry.

Re: Compact a sql.db ?

Thanks Dmitry

I asked this question because I found this thing which is strange.
I've entered a record in a table (i.e Books)
I noticed it had id 4
Then I removed this item 4 and I entered another record.
I thought this one will get in turn id 4.
Well not at all.
It got id 11 (there were others records before it).
Then I wanted to see something
I entered again the previously deleted item.
To my surprise, he resumed his old id (old id 4).
Astounding ! As you write it, I thought that new records would use empty spaces in database.
This is not a problem in itself, but still amazing, do not you think ?
Perhaps there is a logical explanation for this

Have a good day, Dmitry

JB