Bug 132012 - amarok puts high load on mysqld when stopping playback
Summary: amarok puts high load on mysqld when stopping playback
Status: RESOLVED WORKSFORME
Alias: None
Product: amarok
Classification: Applications
Component: general (show other bugs)
Version: 1.4.1
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-07 17:55 UTC by Andreas Pakulat
Modified: 2006-10-28 01:59 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
output from show index from statistics (422 bytes, text/plain)
2006-08-09 14:19 UTC, Andreas Pakulat
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Pakulat 2006-08-07 17:55:06 UTC
Version:            (using KDE KDE 3.5.4)
Installed from:    Debian testing/unstable Packages
OS:                Linux

Hi,

this was introduced with version 1.4 of Amarok. It always puts an extreme load on my mysqld (I havea 1.4GHz Centrino laptop here), which slows down the whole system significantly. 

I already reported a bug with Debian's BTS and attached a query-log there, hopefully there's a way to change this behaviour. See 
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=376809

Andreas
Comment 1 richlv 2006-08-07 18:08:43 UTC
does this happen only when stopping playback ? do you see any additional slowdown upon starting amarok, moving around collection, song advancing etc ?

which mysql version is this (judging by your debian report it probably is the same as client libs - 5.0.22 - but just to make sure) ?

could you, please, post here output of
echo "describe statistics" | mysql -u <amarok_user> -p<password> -h <dbhost> <amarok_database>

this seems quite similar to problems i got with some field types that sort of should have been been updated, sort of should have not...
Comment 2 Andreas Pakulat 2006-08-07 18:44:18 UTC
I did not test collection moving (got only 1 which is too large to move around) but the load is also rather high upon starting amarok (something between 30 to 75% CPU time for mysqld), song advancing doesn't put any load on mysqld.

Yes, it's mysqld 5.0.22-4.

The describe output is:
Field   Type    Null    Key     Default Extra
url     varchar(255)    YES     UNI     NULL
createdate      int(11) YES             NULL
accessdate      int(11) YES             NULL
percentage      float   YES     MUL     NULL
playcounter     int(11) YES     MUL     NULL
rating  int(11) YES     MUL     0

Andreas
Comment 3 richlv 2006-08-07 18:57:28 UTC
ok, maybe you could try this...
a disclaimer first. my knowledge of these things is veeery limited and it might cause loss of data and other problems. so make sure to back things up properly ;)

dump your mysql database.
look into the file, find a string :
CREATE TABLE `statistics` (

in there, look for `url` value, which should have varchar. replace that line (the url one, not table creation one) with

`url` varbinary(255) NOT NULL default '',

(note the varbinary <-> varchar change)

i'm not completely sure, but i believe this should import nicely back ;)
now, import your db dump & try again.
Comment 4 Andreas Pakulat 2006-08-07 19:47:14 UTC
That's what I call an easy fix ;-)

I used phpmyadmin, which would let me alter the type of the column directly. SQL code for this should be

ALTER TABLE statistics CHANGE url VARBINARY(255)

So there's no need for a dump. Do you know what query amarok executes that is so complex for varchar and easy for varbinary?

Andreas
Comment 5 Andrew Turner 2006-08-09 13:34:46 UTC
Andreas, please can you say what version of Amarok you have.

Also, can you please run:

SHOW INDEX FROM statistics
Comment 6 Andreas Pakulat 2006-08-09 14:18:50 UTC
I'm using amarok  1.4.1

I'll create an attachment for the indexes.

Andreas
Comment 7 Andreas Pakulat 2006-08-09 14:19:57 UTC
Created attachment 17306 [details]
output from show index from statistics
Comment 8 Andrew Turner 2006-08-09 22:08:35 UTC
Well, the type of the statistics table URL column has been changed to VARBINARY for 1.4.2-beta1. Quite why you have such serious issues with VARCHAR, I really can't tell, given there are two indices on the URL column.
Comment 9 Alexandre Oliveira 2006-10-28 01:59:44 UTC
Should be fixed with the field change. Test 1.4.3 or 1.4.4 and reopen if necessary.