My sqlite database had grown quite large. I was able to delete a number of tables that were backup copies of other tables. After the deletions, the database size had not changed at all. Is there is a function to "compress" an sqlite database?
If you get overwhelmed by the flow charts and diagrams in SQLite's web site as I do, here is the code. It works:
B4X:
Sub btnCompact_Click
ProgressDialogShow("DATABASE IS BEING COMPACTED. STAND BY")
SQL1.ExecNonQuery("Vacuum")
ProgressDialogHide
Msgbox("DATABASE COMPACTED SUCCESSFULLY.","")
End Sub
Databases (tables) with lots of inserts and deletes should be vacuumed regularly to reduce size, align and improve performance. I was amazed at the size reduction in my DB - several hundred meg.
If you get overwhelmed by the flow charts and diagrams in SQLite's web site as I do, here is the code. It works:
B4X:
Sub btnCompact_Click
ProgressDialogShow("DATABASE IS BEING COMPACTED. STAND BY")
SQL1.ExecNonQuery("Vacuum")
ProgressDialogHide
Msgbox("DATABASE COMPACTED SUCCESSFULLY.","")
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.