[PATCH] [REVIEW:3-5,3-6] size optimisation
Lionel Elie Mamane
lionel at mamane.lu
Tue Jul 3 11:33:13 PDT 2012
I'm unsure whether I should apply this to libreoffice-3-6 or maybe
even libreoffice-3-5; I'd be glad of your opinions.
The issue is that embedded HSQLDB does not reclaim space occupied by
deleted rows; it only overwrites them with new rows. So basically this
means that the data portion of an .odb file NEVER shrinks and only
grows or stagnates.
In particular, people that try to make a minimal reproduction case for
bug reports by deleting a lot of rows still have big files that don't
fit in our bugzilla's size limit (that's how I noticed this issue).
This patch tells HSQLDB, on each flush, to "defrag" the database. This
can take time for big databases :-| and will happen at least for each
file save operation.
The alternative would be to introduce an UI element
"compress/cleanup/defrag database", but:
1) It would necessarily be specific to sdbc(x) direct drivers as AFAIK
odbc / jdbc / ... don't have a standard way to do such an
2) It is not "do the right thing by default"
3) People using big databases should switch to a "real" database
system anyway (and use LibreOffice base as a graphical front-end to
4) More work, and touching the UI, so I won't do it by myself. If we
decide it is the better idea and someone wants to collaborate on
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1222 bytes
Desc: not available
More information about the LibreOffice