PasTim wrote: 
> No, I didn't take a note of it, but what Custom Scan seems to do every
> time is a large number of deletes followed by the inserts.  Once I
> discovered vacuuming I've been running it every time after a scan, and
> it's been a great improvement.  Your tool makes it that much easier.
> 
Just to confirm, Custom Scan will delete all data and re-create it every
time you rescan.
If there are more than 40000 rows for the Custom Tag/Mixed Tag module in
the customscan_track_attributes table, it will instead drop the table
and recreate it, since DELETE is too slow when the table gets large.

PasTim wrote: 
> 
> I wonder whether the scanning for Custom Scan reads a lot of data from
> library.db.  I suspect it does.  If so, a larger buffer might help.
> 
Custom Tag module should for each track do a:

Code:
--------------------
    
  SELECT id,url from tracks where audio=1 limit 1 offset ?
  
--------------------


Mixed Tag module will do INSERT based on SELECT, like for example:

Code:
--------------------
    
  INSERT INTO customscan_track_attributes 
  (
  track,
  url,
  musicbrainz_id,
  module,
  attr,
  value,
  valuesort,
  extravalue,
  valuetype
  ) 
  SELECT 
  tracks.id,
  tracks.url,
  case when tracks.musicbrainz_id like '%-%' then tracks.musicbrainz_id else 
null end,
  'mixedtag',
  ?,
  contributors.name,
  contributors.namesort,
  contributors.id,
  'artist' 
  from tracks,contributor_track,contributors 
  where 
  tracks.audio=1 and 
  tracks.id=contributor_track.track and 
  contributor_track.role=1 and 
  contributor_track.contributor=contributors.id
  
--------------------

There will be a SQL like this for each tag you have configured in the
Mixed Tag scanning module.

I suspect the buffer might help with Mixed Tag scanning module but it
feels like it will have less impact on the Custom Tag scanning module.
However, I haven't had the time to try this myself and I suspect my
library is probably too small to notice any difference. If auto vacuum
works, I suspect it will probably be the biggest improvement related to
Custom Scan related performance.



Erland Isaksson ('My homepage' (http://erland.isaksson.info))
(Developer of 'many plugins/applets (both free and commercial)'
(http://wiki.slimdevices.com/index.php/User:Erland). 
If you like to encourage future presence on this forum and/or third
party plugin/applet development, 'consider purchasing some plugins'
(http://license.isaksson.info))

*Interested in the future of music streaming ? 'ickStream -  A world of
music at your fingertips'
(http://forums.slimdevices.com/showthread.php?98467-Pre-Announcement-ickStream&p=743516)*.
------------------------------------------------------------------------
erland's Profile: http://forums.slimdevices.com/member.php?userid=3124
View this thread: http://forums.slimdevices.com/showthread.php?t=101469

_______________________________________________
beta mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/beta

Reply via email to