I'll start to provide some more details of how the Custom Scan plugin
works today. 
I really want anyone that ideas how to improve the performance of
browsing the Custom Scan data to post in this thread. 

Custom Scan is a generic scanning module where you can add your own
scanning modules. The purpose is to add additional data to the tracks,
artists, albums that already exists in SlimServer, not to add
completely new tracks, artists, albums as the normal SlimServer
scanning does. To simplify this process for the scanning module, the
main Custom Scan plugin will iterate through all SlimServer tracks and
send them track by track to each scanning module. The scanning module
use the track object to get more information and returns the attribute
it likes to add or update. The Custom Scan main module then writes this
information to the track.

The two scanning modules that are relevant in this discussion is:
- *Custom Tag*: Scans additional tags which the user has specified for
each track in the SlimServer library.
- *Mixed Tag*: Reads the album, artist, genre, year information from
the standard SlimServer tables and copy it to the Custom Scan tables,
it also takes a copy of the Custom Tag scanned data.

The purpose of the Custom Tag scanning module is to make SlimServer
aware of custom tags not normally handled by SlimServer.

The purpose of the Mixed Tag scanninng module is to make SlimServer
standard data appear in the same way as the data scanned by Custom Tag.
The reason is to make it easy to create a browse menu where some menu
levels are custom tags and other are standard SlimServer data.

The information scanned with Custom Scan plugin is obviously not used
by the standard SlimServer code since it doesn't know anything about
the Custom Scan tables it creates. There is also not possible to add
this data to the standard SlimServer tables since there are no custom
columns available. So the way you use the data is with the Custom
Browse plugin which makes it possible to create browse menus based on
any SQL statement towards any tables in the SlimServer database.

The information scanned by the Custom Tag and Mixed Tag scanning
modules is today stored in a single table
"customscan_track_attributes", the columns in this table relevant for
this discussion is:
- track (same as tracks.id)
- module (which module the data comes from)
- attr (the tag name)
- value (the actual value of the scanned attribute in text form)
- valuesort (the actual value of the scanned attribute in sort form)
- extravalue (the actual value of the scanned attribute in id form,
this is only used for the data copied from the SlimServer tables and
contains the values from tracks.id, albums.id, genres.id,
contributors.id)

Since the information is stored in a single table today it gets pretty
easy to create code that browses through several attributes. It doesn't
have to care which table the attribute is stored and it doesn't have to
care if the attribute is related to tracks or albums or artists. 

The obvious disadvantage of this solution is the performance in a large
library with many custom tags. For some browse menus this could result
in that a 4,500,000 row table is joined with itself four/five times to
get the result. The user of course expect the result to come very fast
when browsing, a right click shouldn't really take more than a second
or two.

I've setup a number of different indexes, but I expect that with a
4,500,000 row table index can make some things fast but a five time
join on this table, it is probably impossible to get 1-2 second
response time independent which index that are used. But if someone are
good at setting up database index with MySQL, I'm really interesting in
help regarding this.

Now over to my thoughts regarding the purposed solutions, I'll to this
in a separate post coming soon....


-- 
erland

Erland Isaksson
'My homepage' (http://erland.homeip.net) 'My download page'
(http://erland.homeip.net/download)
(Developer of 'TrackStat, SQLPlayList, DynamicPlayList, Custom Browse,
Custom Scan,  Custom Skip, Multi Library and Database Query plugins'
(http://wiki.erland.homeip.net/index.php/Category:SlimServer))
------------------------------------------------------------------------
erland's Profile: http://forums.slimdevices.com/member.php?userid=3124
View this thread: http://forums.slimdevices.com/showthread.php?t=38714

_______________________________________________
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/lists/listinfo/plugins

Reply via email to