Why does clearing an SQLite database not reduce its size?

Posted by Thorsten Lorenz on Stack Overflow See other posts from Stack Overflow or by Thorsten Lorenz
Published on 2010-03-30T11:48:13Z Indexed on 2010/03/30 11:53 UTC
Read the original article Hit count: 356

Filed under:

I have an SQLite database.

I created the tables and filled them with a considerable amount of data.

Then I cleared the database by deleting and recreating the tables. I confirmed that all the data had been removed and the tables were empty by looking at them using SQLite Administrator.

The problem is that the size of the database file (*.db3) remained the same after it had been cleared.

This is of course not desirable as I would like to regain the space that was taken up by the data once I clear it.

Did anyone make a similar observation and/or know what is going on?

What can be done about it?

© Stack Overflow or respective owner

Related posts about sqlite