After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 631180 - Long SQL query (~11000ms) in RandomByScore
Long SQL query (~11000ms) in RandomByScore
Status: RESOLVED NOTGNOME
Product: banshee
Classification: Other
Component: general
1.8.0
Other Linux
: Normal normal
: 1.x
Assigned To: Banshee Maintainers
Banshee Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-10-02 17:26 UTC by Alexander Skiba
Modified: 2011-01-21 18:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
log created with --debug-sql active (132.92 KB, text/plain)
2010-10-02 17:26 UTC, Alexander Skiba
Details

Description Alexander Skiba 2010-10-02 17:26:08 UTC
Created attachment 171579 [details]
log created with --debug-sql active

I have about 6000 Tracks and when I press next or click play while I have shuffle by score active, banshee freezes for seconds and after that plays the title. Same behavior on every repeat of pressing the button.

as suggested by hyperair I added a log with --debug-sql
Comment 1 David Nielsen 2010-10-04 01:40:46 UTC
And here's the culprit:

[2 Debug 19:20:42.083] Executed in 11602ms 
                    SELECT
                        CASE WHEN IFNULL(CoreTracks.Score, 0) = 0 THEN -1 ELSE (CoreTracks.Score - 1) * 20 / 100 END AS Slot, COUNT(*)
                    FROM
                        CoreTracks, CoreCache , CoreSmartPlaylistEntries
                    WHERE
                        CoreCache.ItemId = CoreTracks.TrackID AND
                        CoreCache.ModelID = 304 AND
                        CoreTracks.LastStreamError = 0 AND
                        (CoreTracks.LastPlayedStamp < 1286043627 OR CoreTracks.LastPlayedStamp IS NULL) AND
                        (CoreTracks.LastSkippedStamp < 1286043627 OR CoreTracks.LastSkippedStamp IS NULL)
                         AND  CoreSmartPlaylistEntries.TrackID = CoreTracks.TrackID AND CoreSmartPlaylistEntries.SmartPlaylistID = 21 
                    GROUP BY Slot
Comment 2 Alex L. Mauer 2010-10-13 02:27:10 UTC
This is affecting me as well.  Mine hangs with a line like: [1 Debug 21:02:10.070] Querying model for track to play in score:Next mode

with --debug-sql, it is the same query as above running for a long time (50s for me, on a library of 14000 tracks).

It also causes problems when skipping tracks, as sometimes the current track finishes before the skip activates, and it ends up skipping the following track instead.
Comment 3 Alexander Kojevnikov 2010-10-13 02:31:34 UTC
Confirming now that we have two victims.
Comment 4 David Nielsen 2010-11-04 21:34:22 UTC
I see the log indicates that SQLite 3.7.2 is in use, 3.7.2 is reported to be the cause of performance issues with Banshee[1]. Iane Lane reports that 3.7.3 should fix the known issues[2]. Please retest with 3.7.3 to ensure that this isn't a known regression.

[1] Amongst others:
http://www.omgubuntu.co.uk/2010/11/banshee-2-0-gets-official-release-date-vows-to-provide-excellent-ubuntu-experience/#comment-93354661

[2]
http://www.omgubuntu.co.uk/2010/11/banshee-2-0-gets-official-release-date-vows-to-provide-excellent-ubuntu-experience/#comment-93356133
Comment 5 David Nielsen 2010-12-10 22:39:28 UTC
Users on Maverick believing to be affected by this can mark themselves as being affected by this bug on Launchpad against SQLite requesting an update.

https://bugs.launchpad.net/ubuntu/+source/sqlite3/+bug/688781
Comment 6 Fabio Durán Verdugo 2011-01-20 21:05:25 UTC
this bug has fixed in ubuntu see the link... ^^
Comment 7 Andrés G. Aragoneses (IRC: knocte) 2011-01-21 18:25:04 UTC
If this was a bug in the distribution, it should not be marked as FIXED because there was no fix upstream.