brightway-lca / brightway2-data

Tools for the management of inventory databases and impact assessment methods. Part of the Brightway LCA framework.
https://docs.brightway.dev/
BSD 3-Clause "New" or "Revised" License
8 stars 21 forks source link

Deleting database from project does not reduce .db size #61

Closed aleksandra-kim closed 5 years ago

aleksandra-kim commented 5 years ago

Original report by Pascal Lesage (Bitbucket: MPa, ).


Not sure this is a bug...

I deleted a large database (ecoinvent) from my database, leaving only a few hundred small activities. This did not reduce the size of the database.

Before deletion: just short of 500 MB After deletion: just short of 500 MB

Yet, we see that the database was indeed deleted.

Is this expected behaviour?

![activityDataset Table]("C:\Users\Pascal Lesage\Desktop\activity_database.JPG")

aleksandra-kim commented 5 years ago

Original comment by Chris Mutel (Bitbucket: cmutel, GitHub: cmutel).


This is expected behaviour from SQLite unless an explicit vacuum command is issued. We need: a) Auto-vacuuming if a certain number records (say, 500) are deleted. b) Ability to vacuum on command (should be added to bw2data.sqlite3.SubstitutableDatabase; there is no peewee shortcut so need to run raw SQL).

aleksandra-kim commented 5 years ago

Original comment by Chris Mutel (Bitbucket: cmutel, GitHub: cmutel).


Fix #61. Vacuum automatically when deleting big databases