View Issue Details

IDProjectCategoryView StatusLast Update
0021860MMW 5DB / Backuppublic2026-10-15 15:55
ReporterLudek Assigned To 
PriorityurgentSeverityfeatureReproducibilityhave not tried
Status feedbackResolutionopen 
Product Version2024.2 
Target Version2027.1 
Summary0021860: Database optimization should be automated
DescriptionRusty has sent me his DB that had 2.5 GB size just for 24K of tracks..
After doing 'Optimize database' the size reduced to just 250 MB !!

So it would make sense to optimize DB before doing a backup (to reduce also the size of the backups)

The question just is how often perform the optimization..
To be speeced..
TagsNo tags attached.
Fixed in build

Relationships

related to 0021652 closedLudek Rebuild database should disable other options when selected 
related to 0020825 assignedLudek Tweaks to the 'Manage Database' dialog to improve usability 

Activities

Ludek

2026-01-15 15:34

developer   ~0080312

Last edited: 2026-01-15 15:50

FYI: there is already a new UI for v2026 (per 0021652 ) , so I would rather solve it with target 2026 so that it can be tested through beta testing circle
image.png (38,756 bytes)   
image.png (38,756 bytes)   

Ludek

2026-01-15 15:39

developer   ~0080313

Last edited: 2026-01-15 15:49

Because 'Optimize database' is quite fast task (usually takes less time than the actual backup where compressing part takes the most)
then I would still prefer to Optimize before backup, so probably just a new checkbox

[x] Optimize database before backup

.. BUT this could imply that just the DB that is backed up is optimized

So cleaner approach would be to separate it from backup (like suggested by Rusty) and add the scheduled maintenance, but in that case I believe that 'Optimize database' is the only task that should be scheduled for maintenance.
Idealy if MM could self-detect that DB needs to be optimized and suggested to the user the optimization.

The detection could be based on total amount of tracks in DB versus overal DB size.

Maybe if DB size is over 2GB and the total amount of tracks is less than 100K as a treshold for optimization?

rusty

2026-10-15 15:21

administrator   ~0083032

Perhaps this should just be done completely automatically without any user interaction/configuration whenever a backup is performed if MM detects a problem (i.e. if IF DB optimization hasn't been performed within 7 days AND IF DB size is > xMB per 1000 tracks then automatically initiate optimization). This makes the most sense to me.

--

But if we think that this could add a lot of time/issues to the backup process, then we can make it configurable with a couple of simple UI changes that make the UI even cleaner:

Scheduled maintenance:
[ ] Backup: _Weekly_
 . . [ ] Optimize database
 
OR

Scheduled maintenance:
[ ] Backup: _Weekly_
[ ] Optimize database _on backup, daily, weekly, monthly_

+ (for either of the above options)

Backup and Restore:
Save to: ___________ [Browse...]
Retain backups: ____
Include:
 [ ] Settings
 [ ] Addons

Backup now...
...


Note: if optimization is a zero risk operation, then it could be performed prior to the backup, but if it's not a zero risk operation, then the first option is preferable (i.e. it should be sub to scheduled backup) and should be performed _after_ the backup.