[mythtv] [mythtv-commits] Ticket #3041: MythMusic scanning improvements

Stuart Morgan stuart at tase.co.uk
Wed Feb 21 17:34:15 UTC 2007

On Wednesday 21 February 2007 16:49:28 Steven Adeff wrote:
> >
> >  Attached a patch which has the balance of the scanner changes, it cuts
> >  down the number of db queries significantly. The albumid cache doesn't
> >  work with compilation albums, but that's not a significant problem
> > unless you have a lot of them. There is still room for improvement and
> > optimisation.
> does this make any improvements on scanning m4a files?

Applies to all files. I've not made any format specific scanning optimisations 

The bulk of the changes just bring scanning speeds back down to what they were 
before music metadata was split into several tables. More tables meant a lot 
more queries and some pretty slow joins. By eliminating some of those queries 
and caching the information there is now an average between 1-2 queries per 
file instead of 7+ when adding new files. The performance gain varies 
according to several factors, i.e. number of files per 

There are one or two changes which may improve scanning speed beyond that. I 
guess I'll let people tell me if it's made a noticeable difference as I've 
not benchmarked them.

I did play with stat'ing directories instead of files to improve the speed of 
update scans but for whatever reason stat'ing 360 directories was actually 
slower than ~2000 files. (NFS)
Stuart Morgan

More information about the mythtv-dev mailing list