- I didn't know that the db file itself could get fragmented. I assumed that the db would build itself in the same way that the <Keep iTunes Library Organized> preference keeps the "iTunes Music" folder organized
Just about any file can get fragmented , David. Files that are constantly / very regularly updated tend to do so more than most others. As long as you have plenty of free space it is not likely to become a major issue, as the number of fragments will be low. OSX deals with such things well when there is plenty of room to move. When the disk gets full , though, the level of file fragmentation (and a consequent deterioration in performance when the file has to be accessed or written to), will increase because there aren't any nice large contiguous blocks of space for it to be written to.
Users of large database files and people who edit video are the ones who are usually most conscious of the problems of fragmentation. I guess with a very large iTunes Library (and consequently large iTunes Library databse files), you may well be suffering some of the problems that large database users find they have to deal with.
You can get a free utility called
"ShowVolumeFrag" which allows you to see just how fragmented particular files are. Might well be worth taking a look. I find regularly that the most heavily fragmented files on my own drives are the Spotlight databases and the Microsoft user database. In my case, as the Music library database is below 20 megabytes it gets the benefit of OSX's own defrag routines, and stays reasonably whole (though I see it currently it is split into 6 seperate fragments.)
- I also wasn't aware that the OS automatically defrags an actual file, or that a file needed to be defragged at all.
The "official" view on defragmentation from Apple can be found at
http://docs.info.apple.com/article.html?artnum=25668 . There is also a well known "classic" article on fragmentation issues with the mac at
http://www.kernelthread.com/mac/apme/fragmentation/ which explains the OSX routines well and which argues against defragmentation in most circumstances.
There are, however, many who disagree. Arguments about the matter inevitably become heated unfortunately.
http://www.macfixit.com/article.php?story=20070301091515843 (not sure if this is available if you are not a MacFixit member) provides a useful summary (followed by some shouting by those who comment on the article). Charles Moore, at
http://www.applelinks.com/index.php/more/isdisk_defragmenting_worth_thetrouble/ , provides a well argued counter view and some more links. The post from a Micromat technician
HERE is also worth a read.
Personally my own experience has been that when, over time, fragmentation of free space becomes substantial actual file fragmentation increases rapidly, and defragmenting can produce a substantial improvement in performance for some tasks. Spotlight, for example, is much zippier when its .db files are not fragmented.
I guess its the fact that iTunes libraries of the size being discussed here are somewhat "out of the ordinary" that makes me
suspect that defragmentation may be of value with them. I certainly don't know for sure but it would be interesting to find out.
I thought that journaling took care of this kind of stuff.
Journaling doesn't really have much to do with "fragmentation" issues like this. Journaling " is a system which maintains a secondary record of file locational information. It adds security by reduing the risk of data loss, but it doesn't have any effect on fragmentation. Its worth noting, by the way, that journaling actually exacts a bit of a speed hit of its own. see
http://docs.info.apple.com/article.html?artnum=107249 for an explanation of journaling and its pros and cons.
- Is there anyway to defrag a file manually...or rebuild the iTunes Library? I'm sure if this was possible then someone would have mentioned that by now.
Simply rebuilding the library probably wouldn't generally do the job here, David, as it would most likely be being written to free space which was already somewhat fragmented, unless the disc was reasonably empty. You can defragment a complete drive by simply cloning it to an empty one, of course, using a utility like SuperDuper, wiping the original and then cloning back.
I personally use
iDefrag .
If you have plenty of free space on your drives you probably don't need to defrag most of them very often, if at all, David. Its the drive with the library file on in particular that sounds like it might be worth defragging . It would be interesting to see what the fragmentation level of your iTunes Library file is like first. Maybe you could run
"ShowVolumeFrag" and let us know.
Cheers
Rod