[banshee/stable-1.6] [LibraryWatcher] Fix very slow query



commit 688e594b0983ab3d1009a4933b6dc28c0c56efeb
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Sun Jul 11 14:50:23 2010 -0700

    [LibraryWatcher] Fix very slow query
    
    Adding a PrimarySourceID condition speeds things up greatly (bgo#622826)

 .../Banshee.LibraryWatcher/SourceWatcher.cs        |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/Extensions/Banshee.LibraryWatcher/Banshee.LibraryWatcher/SourceWatcher.cs b/src/Extensions/Banshee.LibraryWatcher/Banshee.LibraryWatcher/SourceWatcher.cs
index 8d28ca0..60d5eb5 100644
--- a/src/Extensions/Banshee.LibraryWatcher/Banshee.LibraryWatcher/SourceWatcher.cs
+++ b/src/Extensions/Banshee.LibraryWatcher/Banshee.LibraryWatcher/SourceWatcher.cs
@@ -189,7 +189,7 @@ namespace Banshee.LibraryWatcher
         {
             using (var reader = ServiceManager.DbConnection.Query (
                 DatabaseTrackInfo.Provider.CreateFetchCommand (
-                "CoreTracks.Uri = ? LIMIT 1"), new SafeUri (track).AbsoluteUri)) {
+                "CoreTracks.PrimarySourceID = ? AND CoreTracks.Uri = ? LIMIT 1"), library.DbId, new SafeUri (track).AbsoluteUri)) {
                 if (reader.Read ()) {
                     var track_info = DatabaseTrackInfo.Provider.Load (reader);
                     if (Banshee.IO.File.GetModifiedTime (track_info.Uri) > track_info.FileModifiedStamp) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]