On Fri, Oct 21, 2016 at 08:03:53PM +0200, Tinu Weber wrote:
On Fri, Oct 21, 2016 at 17:20:53 +0000, Alive 4ever wrote:
[...] It seems that the local pacman databases are just subdirectories with text files (desc, files) and gzipped text (mtree). No wonder why local pacman databases tend to slow down over time and need to be optimized periodically. This is a little contradictory: if it is just directories with text files (plain or compressed), how does it need "periodical optimisation"? What is optimised? And how? Local text files uses the underlying filesystem capability to optimize. Currently, pacman package includes a ``pacman-optimize`` script to do manual periodic local database optimization.
Invoking ``pacman-optimize --help`` should give you a hint that pacman developers recognize that there is a problem with many small files: filesystem fragmentation. Basically, the optimization is just file system rotation. The old databases are archived into tar files in the tmp, the local database is moved/renamed, the tar archive of local database is extracted back to its original location. If everything goes fine, the renamed old database is deleted.
This would provide faster access for local database as sql databases are optimized for fast access. This just adds complexity, and for what? Marginal performance gain (if at all? honestly, `pacman -Q` runs almost instantly here).
Filesystem fragmentation is no problem for faster disk.
Best, Tinu/ayekat