B Bill Norris Active Member Licensed User Longtime User Jun 5, 2012 #1 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?
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?
klaus Expert Licensed User Longtime User Jun 5, 2012 #2 You could try to execute VACUUM I've never tried it. Best regards. Upvote 0
M Mahares Expert Licensed User Longtime User Jun 5, 2012 #3 If you get overwhelmed by the flow charts and diagrams in SQLite's web site as I do, here is the code. It works: Code: Copy Sub btnCompact_Click ProgressDialogShow("DATABASE IS BEING COMPACTED. STAND BY") SQL1.ExecNonQuery("Vacuum") ProgressDialogHide Msgbox("DATABASE COMPACTED SUCCESSFULLY.","") End Sub Upvote 0
If you get overwhelmed by the flow charts and diagrams in SQLite's web site as I do, here is the code. It works: Code: Copy Sub btnCompact_Click ProgressDialogShow("DATABASE IS BEING COMPACTED. STAND BY") SQL1.ExecNonQuery("Vacuum") ProgressDialogHide Msgbox("DATABASE COMPACTED SUCCESSFULLY.","") End Sub
Harris Expert Licensed User Longtime User Jun 5, 2012 #4 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. Upvote 0
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.
C colboy Member Licensed User Longtime User Jun 6, 2012 #5 Just a word of warning, always backup the database before performing a VACUUM. Better to err on the side of caution. Colin Mahares said: If you get overwhelmed by the flow charts and diagrams in SQLite's web site as I do, here is the code. It works: Code: Copy Sub btnCompact_Click ProgressDialogShow("DATABASE IS BEING COMPACTED. STAND BY") SQL1.ExecNonQuery("Vacuum") ProgressDialogHide Msgbox("DATABASE COMPACTED SUCCESSFULLY.","") End Sub Click to expand... Upvote 0
Just a word of warning, always backup the database before performing a VACUUM. Better to err on the side of caution. Colin Mahares said: If you get overwhelmed by the flow charts and diagrams in SQLite's web site as I do, here is the code. It works: Code: Copy Sub btnCompact_Click ProgressDialogShow("DATABASE IS BEING COMPACTED. STAND BY") SQL1.ExecNonQuery("Vacuum") ProgressDialogHide Msgbox("DATABASE COMPACTED SUCCESSFULLY.","") End Sub Click to expand...