Jump to content

Database size not changing after archiving revision


manish

Recommended Posts

Hello,

 

In your documentation, you state " Once a revision has been archived it is taken out the database." 

(https://www.plasticscm.com/documentation/administration/plastic-scm-version-control-administrator-guide.shtml#Whyarchivingrevisions)

 

We recently tried archiving a sizeable binary file and we did not see the size of the database change at all. For example,

 

The binary file was around 20 mb, after commiting a few changes we naturally saw the repo database size increase,

 

We then tried to archive that binary using the instructions from this thread

(http://www.plasticscm.net/index.php?/topic/1064-question-about-archiving-revisions/)

 

We did not see the repo db size go down, we assumed that would happen based on the "once archived it is taken out of the database"

We tried archiving each changeset number with the file ("#cs:x") and also the latest on main branch (#br:/main).

 

This is actually a test for managing repo db size for a few very large binary files that are several GB each.

Are we doing something wrong? Are we expecting the wrong behavior?

 

We are using v5.4.16.686, eval on Windows 8,1 with SqlLite backend db

 

Thanks!

Link to comment
Share on other sites

Hi!

 

you are archiving the revision right.

 

Let me explain what's happening.

 

When you archive a revision from the DB you are actually removing 20MB from the database but the db engine will keep those 20MB allocated for further insertions, so the disk spot is actually not released.

 

I'm not 100% sure about sqlite, but SqlServer for example is able to "repack" the database defragmenting the unused spots. Re-writing the database will also release disk, dumping a backup and importing it will do it, replicating the repo to another one will do it too.

Link to comment
Share on other sites

Sure!

 

We were using SQLlite in Windows for demo purposes. You can do this by performing a "VACUUM" command on the SQLite database.

For a common Windows GUI such as "DB Browser for SQLite" you will need to open the target database, then click "File -> Compact Database"

Here is some literature on the vacuum family of commands: http://www.tutorialspoint.com/sqlite/sqlite_vacuum.htm

 

Other databases have similar maintenance functions. For example, MySQL command to "OPTIMIZE TABLE" will perform similar functions. There are also various methodologies such as dumping the db then reloading it back. https://dev.mysql.com/doc/refman/5.7/en/table-maintenance-sql.html

 

One note: for most of these databases, rebuild, optimize, etc... are very expensive operations and is important to fully read the documentation of the commands to know what is going on when performing it and whether or not it is worth it for your scenarios.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...