View Issue Details

IDProjectCategoryView StatusLast Update
0003208MMW v4DB/FileMonitorpublic2007-08-03 19:06
Reporterjiri Assigned To 
PriorityurgentSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.0 
Fixed in Version3.0 
Summary0003208: Optimize and fix some queries
DescriptionSome queries, most importantly those searching for Artist or Genre aren't currenlty implemented well in the context of the new MM 3.0 DB structure. E.g. Genre searchs look directly in Genre field in Songs table. What it should do instead is to use joined Genre and GenreSongs tables to find song IDs with given genre (or part of genre). The same applies to Artist searches or Classification (Mood, Tempo, ...) searches (I haven't checked out these).
TagsNo tags attached.
Fixed in build1058

Activities

Ludek

2007-06-29 21:06

developer   ~0009623

Last edited: 2007-06-30 09:51

I guess that searching directly in Songs.Genre field instead of searching via GenreSongs table is used only in case of searchig a text fields so that it would be more faster.
e.g. if you search genre contains "trip" then there is no need to search it via the GenreSongs table because you can search directly in the Songs.Genre field.

jiri

2007-06-30 10:23

administrator   ~0009626

No, it is significantly better to use Genres and GenreSongs tables. The thing is that if you look for a genre 'trip' in Songs table, you have to go trough all records in Songs table (i.e. even ~100k), which means to read almost the whole DB file from disk (i.e. easily >200MB). On the other hand, using Genres table involves only search of some 0000071:0000100 genres, the rest goes over indexed IDs. So, while the query will be a couple of characters longer, the execution time will be _significantly_ smaller.

Ludek

2007-06-30 17:38

developer   ~0009630

Last edited: 2007-07-09 10:03

You are probably right, but according to what I have tested so far on my DB your proposal takes longer (both preparing and executing of the query).
Once I can test it on a realy big DB I could find out whether your proposal is better, but I cannot use the big DB from our ftp because of some DB updates. I need a newer one.

jiri

2007-07-31 09:36

administrator   ~0010018

Recent note from a user reminded me that this isn't just a performance issue, it's actually a bug. By words of the user:

----
I noticed one more thing. Searching for Artists that starts with Ferry doesn't include [Tiesto;Ferry Corsten] in the result, That's because the search is performed on the Artist field in Songs table rather than the Artist field in the Artists table.
----

I.e. we _must_ implement it the suggested way.

As for the large DB, I guess it isn't necessary to test it, but anyway I have uploaded the latest version as BigDBLatest.rar to FTP (but I think that the previous version should work too after MM updates it).

jiri

2007-07-31 10:01

administrator   ~0010019

Btw, the same problem for Mood and other fields is reported at http://www.mediamonkey.com/forum/viewtopic.php?p=97984#97984

Ludek

2007-08-03 19:05

developer   ~0010057

All is fixed in build 1058.

Btw. The problem with multiple Moods, Tempos, Occasions... were about storing into DB.