diff --git a/src/Core/Banshee.Core/Banshee.Base/SafeUri.cs b/src/Core/Banshee.Core/Banshee.Base/SafeUri.cs
index 171d1d7..3feeb72 100644
--- a/src/Core/Banshee.Core/Banshee.Base/SafeUri.cs
+++ b/src/Core/Banshee.Core/Banshee.Base/SafeUri.cs
@@ -48,6 +48,10 @@ namespace Banshee.Base
 
         public SafeUri (string uri)
         {
+            if (String.IsNullOrEmpty (uri)) {
+                throw new ArgumentNullException ("uri");
+            }
+
             int scheme_delimit_index = uri.IndexOf ("://");
             if (scheme_delimit_index > 0 && scheme_delimit_index <= MAX_SCHEME_LENGTH) {
                 this.uri = uri;
diff --git a/src/Core/Banshee.Core/Banshee.Collection/TrackInfo.cs b/src/Core/Banshee.Core/Banshee.Collection/TrackInfo.cs
index c0b05af..af8dacd 100644
--- a/src/Core/Banshee.Core/Banshee.Collection/TrackInfo.cs
+++ b/src/Core/Banshee.Core/Banshee.Collection/TrackInfo.cs
@@ -141,8 +141,24 @@ namespace Banshee.Collection
             get { return (IsPlayingMethod != null) ? IsPlayingMethod (this) : false; }
         }
 
+
+        private SafeUri uri = null;
+
         [Exportable (ExportName = "URI")]
-        public virtual SafeUri Uri { get; set; }
+        public virtual SafeUri Uri {
+            get {
+                if (uri == null) {
+                    uri = new SafeUri (FileLocation + FileName);
+                }
+                return uri;
+            }
+            set {
+                uri = value;
+                FileName = System.IO.Path.GetFileName (value.AbsoluteUri);
+                FileLocation = value.AbsoluteUri.Substring (0, value.AbsoluteUri.Length - FileName.Length);
+            }
+        }
+
 
         [Exportable]
         public string LocalPath {
@@ -156,6 +172,12 @@ namespace Banshee.Collection
         public virtual string MimeType { get; set; }
 
         [Exportable]
+        public virtual string FileName { get; set; }
+
+        [Exportable]
+        public virtual string FileLocation { get; set; }
+
+        [Exportable]
         public virtual long FileSize { get; set; }
 
         public virtual long FileModifiedStamp { get; set; }
diff --git a/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs b/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs
index 41ff4b1..c82f41b 100644
--- a/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs
+++ b/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs
@@ -393,10 +393,30 @@ namespace Banshee.Collection.Database
             set { base.MusicBrainzId = value; }
         }
 
-        [DatabaseColumn ("Uri")]
         protected string UriField {
-            get { return Uri == null ? null : Uri.AbsoluteUri; }
-            set { Uri = value == null ? null : new SafeUri (value); }
+            get {
+                if (Uri == null) {
+                    Uri = new SafeUri (FileLocation + FileName);
+                }
+                return Uri.AbsoluteUri;
+            }
+            set {
+                Uri = new SafeUri (value);
+                FileName = System.IO.Path.GetFileName (value);
+                FileLocation = value.Substring (0, value.Length - FileName.Length);
+            }
+        }
+
+        [DatabaseColumn]
+        public override string FileName {
+            get;
+            set;
+        }
+
+        [DatabaseColumn]
+        public override string FileLocation {
+            get;
+            set;
         }
 
         [DatabaseColumn]
@@ -699,14 +719,17 @@ namespace Banshee.Collection.Database
             return copy_success;
         }
 
-        private static HyenaSqliteCommand get_uri_id_cmd = new HyenaSqliteCommand ("SELECT TrackID FROM CoreTracks WHERE Uri = ? LIMIT 1");
+        private static HyenaSqliteCommand get_uri_id_cmd = new HyenaSqliteCommand (
+            "SELECT TrackID FROM CoreTracks WHERE FileLocation||FileName = ? LIMIT 1"
+        );
+
         public static int GetTrackIdForUri (string uri)
         {
             return ServiceManager.DbConnection.Query<int> (get_uri_id_cmd, new SafeUri (uri).AbsoluteUri);
         }
 
         private static HyenaSqliteCommand get_track_id_by_uri = new HyenaSqliteCommand (
-            "SELECT TrackID FROM CoreTracks WHERE PrimarySourceId IN (?) AND Uri = ? LIMIT 1"
+            "SELECT TrackID FROM CoreTracks WHERE PrimarySourceId IN (?) AND FileLocation||FileName = ? LIMIT 1"
         );
 
         public static int GetTrackIdForUri (SafeUri uri, int [] primary_sources)
diff --git a/src/Core/Banshee.Services/Banshee.Collection/RescanPipeline.cs b/src/Core/Banshee.Services/Banshee.Collection/RescanPipeline.cs
index d143a5a..b681496 100644
--- a/src/Core/Banshee.Services/Banshee.Collection/RescanPipeline.cs
+++ b/src/Core/Banshee.Services/Banshee.Collection/RescanPipeline.cs
@@ -101,7 +101,7 @@ namespace Banshee.Collection
 
             // Delete tracks that are under the BaseDirectory and that weren't rescanned just now
             string condition = String.Format (
-                "WHERE PrimarySourceID = ? AND Uri LIKE '{0}%' AND LastSyncedStamp IS NOT NULL AND LastSyncedStamp < ?",
+                "WHERE PrimarySourceID = ? AND FileLocation||FileNameUri LIKE '{0}%' AND LastSyncedStamp IS NOT NULL AND LastSyncedStamp < ?",
                 new SafeUri (psource.BaseDirectoryWithSeparator).AbsoluteUri
             );
 
@@ -139,7 +139,7 @@ namespace Banshee.Collection
             this.scan_started = scan_started;
 
             fetch_command = DatabaseTrackInfo.Provider.CreateFetchCommand (
-                "CoreTracks.PrimarySourceID = ? AND CoreTracks.Uri = ? LIMIT 1");
+                "CoreTracks.PrimarySourceID = ? AND CoreTracks.FileLocation||CoreTracks.FileName = ? LIMIT 1");
 
             fetch_similar_command = DatabaseTrackInfo.Provider.CreateFetchCommand (
                 "CoreTracks.PrimarySourceID = ? AND CoreTracks.LastSyncedStamp < ? AND CoreTracks.MetadataHash = ?");
diff --git a/src/Core/Banshee.Services/Banshee.Database/BansheeDbFormatMigrator.cs b/src/Core/Banshee.Services/Banshee.Database/BansheeDbFormatMigrator.cs
index 93aa331..7b330c0 100644
--- a/src/Core/Banshee.Services/Banshee.Database/BansheeDbFormatMigrator.cs
+++ b/src/Core/Banshee.Services/Banshee.Database/BansheeDbFormatMigrator.cs
@@ -28,9 +28,11 @@
 //
 
 using System;
+using System.Collections.Generic;
 using System.Data;
 using System.Reflection;
 using System.Text;
+using System.Text.RegularExpressions;
 using System.Threading;
 using Mono.Unix;
 using Mono.Data.Sqlite;
@@ -56,7 +58,7 @@ namespace Banshee.Database
         // NOTE: Whenever there is a change in ANY of the database schema,
         //       this version MUST be incremented and a migration method
         //       MUST be supplied to match the new version number
-        protected const int CURRENT_VERSION = 41;
+        protected const int CURRENT_VERSION = 42;
         protected const int CURRENT_METADATA_VERSION = 7;
 
 #region Migration Driver
@@ -924,6 +926,36 @@ namespace Banshee.Database
             return true;
         }
 
+        [DatabaseVersion (42)]
+        private bool Migrate_42 ()
+        {
+            Execute ("DROP INDEX IF EXISTS CoreTracksIndex");
+
+            Execute ("ALTER TABLE CoreTracks ADD COLUMN FileLocation TEXT");
+            Execute ("ALTER TABLE CoreTracks ADD COLUMN FileName TEXT");
+            Execute (@"UPDATE CoreTracks SET FileName = HYENA_URI_TO_FILE_NAME (Uri),
+                                             FileLocation = HYENA_URI_TO_FILE_LOCATION (Uri)");
+
+            //Removing columns is not supported according to http://www.sqlite.org/lang_altertable.html
+            //so we apply this workaround mentioned in http://www.fredshack.com/docs/sqlite.html (we want to remove Uri)
+            string temp_name_for_new_table = "NewCoreTracks";
+            Table temp_new_core_tracks = CoreTracks.Clone ();
+            temp_new_core_tracks.Name = temp_name_for_new_table;
+
+            Execute (temp_new_core_tracks.GetCreationStatement ());
+            Execute (String.Format ("INSERT INTO {0} SELECT {1} FROM CoreTracks",
+                                    temp_name_for_new_table,
+                                    CoreTracks.GetColumnNamesCommaSeparated ()));
+            Execute (String.Format ("DROP TABLE {0}", CoreTracks.Name));
+
+            Execute (CoreTracks.GetCreationStatement ());
+            Execute (String.Format ("INSERT INTO CoreTracks SELECT * FROM {0}", temp_name_for_new_table));
+            Execute (String.Format ("DROP TABLE {0}", temp_name_for_new_table));
+
+            Execute ("CREATE INDEX IF NOT EXISTS CoreTracksIndex ON CoreTracks(ArtistID, AlbumID, PrimarySourceID, Disc, TrackNumber, FileLocation, FileName)");
+
+            return true;
+        }
 
 #pragma warning restore 0169
 
@@ -965,66 +997,12 @@ namespace Banshee.Database
             ");
             Execute ("INSERT INTO CorePrimarySources (StringID) VALUES ('MusicLibrarySource-Library')");
 
-            // TODO add these:
-            // Others to consider:
-            // AlbumArtist (TPE2) (in CoreAlbums?)
-            Execute(String.Format (@"
-                CREATE TABLE CoreTracks (
-                    PrimarySourceID     INTEGER NOT NULL,
-                    TrackID             INTEGER PRIMARY KEY,
-                    ArtistID            INTEGER,
-                    AlbumID             INTEGER,
-                    TagSetID            INTEGER,
-                    ExternalID          INTEGER,
-
-                    MusicBrainzID       TEXT,
-
-                    Uri                 TEXT,
-                    MimeType            TEXT,
-                    FileSize            INTEGER,
-                    BitRate             INTEGER,
-                    SampleRate          INTEGER,
-                    BitsPerSample       INTEGER,
-                    Attributes          INTEGER DEFAULT {0},
-                    LastStreamError     INTEGER DEFAULT {1},
+            Execute (CoreTracks.GetCreationStatement ());
 
-                    Title               TEXT,
-                    TitleLowered        TEXT,
-                    TitleSort           TEXT,
-                    TitleSortKey        BLOB,
-                    TrackNumber         INTEGER,
-                    TrackCount          INTEGER,
-                    Disc                INTEGER,
-                    DiscCount           INTEGER,
-                    Duration            INTEGER,
-                    Year                INTEGER,
-                    Genre               TEXT,
-                    Composer            TEXT,
-                    Conductor           TEXT,
-                    Grouping            TEXT,
-                    Copyright           TEXT,
-                    LicenseUri          TEXT,
-
-                    Comment             TEXT,
-                    Rating              INTEGER,
-                    Score               INTEGER,
-                    PlayCount           INTEGER,
-                    SkipCount           INTEGER,
-                    LastPlayedStamp     INTEGER,
-                    LastSkippedStamp    INTEGER,
-                    DateAddedStamp      INTEGER,
-                    DateUpdatedStamp    INTEGER,
-                    MetadataHash        TEXT,
-                    BPM                 INTEGER,
-                    LastSyncedStamp     INTEGER,
-                    FileModifiedStamp   INTEGER
-                )
-            ", (int)TrackMediaAttributes.Default, (int)StreamPlaybackError.None));
-
-            Execute("CREATE INDEX CoreTracksPrimarySourceIndex ON CoreTracks(ArtistID, AlbumID, PrimarySourceID, Disc, TrackNumber, Uri)");
+            Execute("CREATE INDEX CoreTracksPrimarySourceIndex ON CoreTracks(ArtistID, AlbumID, PrimarySourceID, Disc, TrackNumber, FileLocation, FileName)");
             Execute("CREATE INDEX CoreTracksAggregatesIndex ON CoreTracks(FileSize, Duration)");
             Execute("CREATE INDEX CoreTracksExternalIDIndex ON CoreTracks(PrimarySourceID, ExternalID)");
-            Execute("CREATE INDEX CoreTracksUriIndex ON CoreTracks(PrimarySourceID, Uri)");
+            Execute("CREATE INDEX CoreTracksUriIndex ON CoreTracks(PrimarySourceID, FileLocation, FileName)");
             Execute("CREATE INDEX CoreTracksCoverArtIndex ON CoreTracks (PrimarySourceID, AlbumID, DateUpdatedStamp)");
 
             Execute(@"
@@ -1165,6 +1143,74 @@ namespace Banshee.Database
             Execute ("CREATE INDEX CoreShuffleModificationsIndex ON CoreShuffleModifications (ShufflerId, TrackID, LastModifiedAt, ModificationType)");
         }
 
+        private string CoreTracksCommonColumns {
+            get {
+                // TODO add these:
+                // Others to consider:
+                // AlbumArtist (TPE2) (in CoreAlbums?)
+                return String.Format (@"
+                    PrimarySourceID     INTEGER NOT NULL,
+                    TrackID             INTEGER PRIMARY KEY,
+                    ArtistID            INTEGER,
+                    AlbumID             INTEGER,
+                    TagSetID            INTEGER,
+                    ExternalID          INTEGER,
+
+                    MusicBrainzID       TEXT,
+
+                    FileLocation        TEXT,
+                    FileName            TEXT,
+                    MimeType            TEXT,
+                    FileSize            INTEGER,
+                    BitRate             INTEGER,
+                    SampleRate          INTEGER,
+                    BitsPerSample       INTEGER,
+                    Attributes          INTEGER DEFAULT {0},
+                    LastStreamError     INTEGER DEFAULT {1},
+
+                    Title               TEXT,
+                    TitleLowered        TEXT,
+                    TitleSort           TEXT,
+                    TitleSortKey        BLOB,
+                    TrackNumber         INTEGER,
+                    TrackCount          INTEGER,
+                    Disc                INTEGER,
+                    DiscCount           INTEGER,
+                    Duration            INTEGER,
+                    Year                INTEGER,
+                    Genre               TEXT,
+                    Composer            TEXT,
+                    Conductor           TEXT,
+                    Grouping            TEXT,
+                    Copyright           TEXT,
+                    LicenseUri          TEXT,
+
+                    Comment             TEXT,
+                    Rating              INTEGER,
+                    Score               INTEGER,
+                    PlayCount           INTEGER,
+                    SkipCount           INTEGER,
+                    LastPlayedStamp     INTEGER,
+                    LastSkippedStamp    INTEGER,
+                    DateAddedStamp      INTEGER,
+                    DateUpdatedStamp    INTEGER,
+                    MetadataHash        TEXT,
+                    BPM                 INTEGER,
+                    LastSyncedStamp     INTEGER,
+                    FileModifiedStamp   INTEGER
+                ", (int)TrackMediaAttributes.Default, (int)StreamPlaybackError.None);
+            }
+        }
+
+        Table core_tracks;
+        private Table CoreTracks {
+            get {
+                if (core_tracks == null)
+                    core_tracks = new Table ("CoreTracks", Column.GetColumnsFromCommaSeparatedList (CoreTracksCommonColumns));
+                return core_tracks;
+            }
+        }
+
 #endregion
 
 #region Legacy database migration
@@ -1195,9 +1241,9 @@ namespace Banshee.Database
 
             Execute (String.Format (@"
                 INSERT INTO CoreTracks
-                    (PrimarySourceID, TrackID, ArtistID, AlbumID, TagSetID, ExternalID, MusicBrainzID, Uri, MimeType,
-                    FileSize, BitRate, Attributes, LastStreamError, Title, TitleLowered, TrackNumber, TrackCount,
-                    Disc, DiscCount, Duration, Year, Genre, Composer, Conductor, Grouping, Copyright, LicenseUri,
+                    (PrimarySourceID, TrackID, ArtistID, AlbumID, TagSetID, ExternalID, MusicBrainzID, FileLocation,
+                    FileName, MimeType, FileSize, BitRate, Attributes, LastStreamError, Title, TitleLowered, TrackNumber,
+                    TrackCount, Disc, DiscCount, Duration, Year, Genre, Composer, Conductor, Grouping, Copyright, LicenseUri,
                     Comment, Rating, Score, PlayCount, SkipCount, LastPlayedStamp, LastSkippedStamp, DateAddedStamp,
                     DateUpdatedStamp, MetadataHash, BPM, LastSyncedStamp, FileModifiedStamp)
                     SELECT
@@ -1214,7 +1260,8 @@ namespace Banshee.Database
                         0,
                         0,
                         0,
-                        Uri,
+                        HYENA_URI_TO_FILE_LOCATION (Uri),
+                        HYENA_URI_TO_FILE_NAME (Uri),
                         MimeType,
                         0, 0,
                         {0},
@@ -1425,4 +1472,87 @@ namespace Banshee.Database
             return Banshee.Base.SafeUri.FilenameToUri (full_path);
         }
     }
+
+    internal class Column {
+
+        internal string Name { get; private set; }
+        internal string Type { get; private set; }
+
+        internal Column (string name, string type)
+        {
+            Name = name;
+            Type = type;
+        }
+
+        internal static List<Column> GetColumnsFromCommaSeparatedList (string comma_separated_list)
+        {
+            var list = new List<Column> ();
+            string [] cols = comma_separated_list.Split (',');
+            Regex regex = new Regex (@"[^\s]+");
+            foreach (string col in cols) {
+                var matches = regex.Matches (col);
+
+                if (matches.Count < 2)
+                    throw new FormatException ("Each column must have a name and a type");
+
+                string name = matches [0].Value;
+
+                string type = matches [1].Value;
+                for (int i = 2; i < matches.Count; i++)
+                    type += " " + matches [i].Value;
+
+                list.Add (new Column (name, type));
+            }
+            return list;
+        }
+    }
+
+    internal class Table {
+        List<Column> columns;
+
+        internal string Name { get; set; }
+        internal Table (string name, List<Column> columns)
+        {
+            this.columns = columns;
+            Name = name;
+        }
+
+        internal Table Clone ()
+        {
+            return new Table (Name, new List<Column> (columns.ToArray ()));
+        }
+
+        internal List<string> GetColumnNames ()
+        {
+            var column_names = new List<string> ();
+            foreach (Column c in columns) {
+                column_names.Add (c.Name);
+            }
+            return column_names;
+        }
+
+        internal string GetColumnNamesCommaSeparated ()
+        {
+            var column_names = GetColumnNames ();
+            string names = column_names [0];
+            column_names.Remove (names);
+            foreach (string name in column_names) {
+                names += "," + name;
+            }
+            return names;
+        }
+
+        internal string GetCreationStatement ()
+        {
+            if (columns.Count == 0) {
+                throw new NotSupportedException ("Table must contain at least 1 column");
+            }
+            Column first_column = columns [0];
+            string columns_declaration = first_column.Name + " " + first_column.Type;
+            for (int i = 1; i < columns.Count; i++) {
+                columns_declaration += "," + columns [i].Name + " " + columns [i].Type;
+            }
+            return String.Format ("CREATE TABLE {0} ({1})", Name, columns_declaration);
+        }
+    }
 }
diff --git a/src/Core/Banshee.Services/Banshee.Query/BansheeQuery.cs b/src/Core/Banshee.Services/Banshee.Query/BansheeQuery.cs
index e088ceb..f8ebda5 100644
--- a/src/Core/Banshee.Services/Banshee.Query/BansheeQuery.cs
+++ b/src/Core/Banshee.Services/Banshee.Query/BansheeQuery.cs
@@ -259,12 +259,28 @@ namespace Banshee.Query
 
         public static QueryField UriField = new QueryField (
             "uri", "Uri",
-            Catalog.GetString ("File Location"), "CoreTracks.Uri", typeof(ExactUriStringQueryValue),
+            Catalog.GetString ("File Path"), "CoreTracks.FileLocation||CoreTracks.FileName", typeof(ExactUriStringQueryValue),
             // Translators: These are unique search fields. You can use CSV for synonyms. Please, no spaces. Blank ok.
-            Catalog.GetString ("uri"), Catalog.GetString ("path"), Catalog.GetString ("file"), Catalog.GetString ("location"),
-            "uri", "path", "file", "location"
+            Catalog.GetString ("uri"), Catalog.GetString ("path"),
+            "uri", "path"
         );
 
+        public static QueryField FileLocationField = new QueryField (
+            "filelocation", "FileLocation",
+            Catalog.GetString ("File Location"), "CoreTracks.FileLocation", typeof (ExactStringQueryValue),
+            // Translators: These are unique search fields.  Please, no spaces. Blank ok.
+            Catalog.GetString ("file location"), Catalog.GetString ("location"),
+            "file location", "location"
+        );
+
+        public static QueryField FileNameField = new QueryField (
+            "filename", "FileName",
+            Catalog.GetString ("File Name"), "CoreTracks.FileName", typeof (ExactStringQueryValue),
+            // Translators: These are unique search fields.  Please, no spaces. Blank ok.
+            Catalog.GetString ("file"), Catalog.GetString ("file name"),
+            "file", "file name"
+         );
+
         public static QueryField DurationField = new QueryField (
             "duration", "Duration",
             Catalog.GetString ("Time"), "CoreTracks.Duration", typeof(TimeSpanQueryValue),
@@ -338,7 +354,7 @@ namespace Banshee.Query
         public static QueryFieldSet FieldSet = new QueryFieldSet (
             ArtistField, AlbumField, AlbumArtistField, TitleField, TrackNumberField, TrackCountField, DiscNumberField, DiscCountField,
             YearField, GenreField, ComposerField, ConductorField, GroupingField, CommentField, LicenseUriField, RatingField, PlayCountField,
-            SkipCountField, FileSizeField, UriField, DurationField, MimeTypeField, LastPlayedField, LastSkippedField,
+            SkipCountField, FileSizeField, UriField, FileLocationField, FileNameField, DurationField, MimeTypeField, LastPlayedField, LastSkippedField,
             BpmField, BitRateField, SampleRateField, BitsPerSampleField, DateAddedField, PlaylistField, SmartPlaylistField, ScoreField, PlaybackErrorField
         );
 
@@ -499,6 +515,13 @@ namespace Banshee.Query
                 case "lastskippedstamp":
                 case "dateaddedstamp":
                 case "uri":
+                    //FIXME: this is done because of the bug found in DefaultColumnController.Create(...),
+                    //       where the ctor of SortableColumn is called. This should become fixed if the TODO above is done
+                    sort_query = String.Format (
+                        "{0} {1}, {2}",
+                        "CoreTracks.FileLocation||CoreTracks.FileName", ascDesc, default_sort
+                    );
+                    break;
                 case "mimetype":
                 case "licenseuri":
                     sort_query = String.Format (
diff --git a/src/Core/Banshee.Services/Banshee.Sources/PrimarySource.cs b/src/Core/Banshee.Services/Banshee.Sources/PrimarySource.cs
index 604d4e5..089dff5 100644
--- a/src/Core/Banshee.Services/Banshee.Sources/PrimarySource.cs
+++ b/src/Core/Banshee.Services/Banshee.Sources/PrimarySource.cs
@@ -105,11 +105,11 @@ namespace Banshee.Sources
         protected bool error_source_visible = false;
 
         protected string remove_range_sql = @"
-            INSERT INTO CoreRemovedTracks (DateRemovedStamp, TrackID, Uri) SELECT ?, TrackID, Uri FROM CoreTracks WHERE TrackID IN (SELECT {0});
+            INSERT INTO CoreRemovedTracks (DateRemovedStamp, TrackID, Uri) SELECT ?, TrackID, FileLocation||FileName FROM CoreTracks WHERE TrackID IN (SELECT {0});
             DELETE FROM CoreTracks WHERE TrackID IN (SELECT {0})";
 
         protected HyenaSqliteCommand remove_list_command = new HyenaSqliteCommand (@"
-            INSERT INTO CoreRemovedTracks (DateRemovedStamp, TrackID, Uri) SELECT ?, TrackID, Uri FROM CoreTracks WHERE TrackID IN (SELECT ItemID FROM CoreCache WHERE ModelID = ?);
+            INSERT INTO CoreRemovedTracks (DateRemovedStamp, TrackID, Uri) SELECT ?, TrackID, FileLocation||FileName FROM CoreTracks WHERE TrackID IN (SELECT ItemID FROM CoreCache WHERE ModelID = ?);
             DELETE FROM CoreTracks WHERE TrackID IN (SELECT ItemID FROM CoreCache WHERE ModelID = ?)
         ");
 
@@ -597,7 +597,9 @@ namespace Banshee.Sources
             return true;
         }
 
-        private static HyenaSqliteCommand get_track_id_cmd = new HyenaSqliteCommand ("SELECT TrackID FROM CoreTracks WHERE PrimarySourceId = ? AND Uri = ? LIMIT 1");
+        private static HyenaSqliteCommand get_track_id_cmd = new HyenaSqliteCommand (
+            "SELECT TrackID FROM CoreTracks WHERE PrimarySourceId = ? AND FileLocation||FileName = ? LIMIT 1"
+        );
         public int GetTrackIdForUri (string uri)
         {
             return ServiceManager.DbConnection.Query<int> (get_track_id_cmd, DbId, new SafeUri (uri).AbsoluteUri);
diff --git a/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/DefaultColumnController.cs b/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/DefaultColumnController.cs
index 32b8219..f6d545e 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/DefaultColumnController.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/DefaultColumnController.cs
@@ -179,7 +179,11 @@ namespace Banshee.Collection.Gui
             SortableColumn col = new SortableColumn (
                 field.ShortLabel,
                 cell,
-                width, field.Name, visible
+                width,
+                field.Name, //FIXME: this is a bug (exposed by the feature BGO#563630, because Uri now becomes 2 joined columns)
+                            //so this should read field.Column, or just field, to have the field inside the SortableColumn
+                            //for now we have done a workaround for this in BansheeQuery.GetSort(str,str)
+                visible
             );
             col.LongTitle = field.Label;
             col.Field = field;
diff --git a/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage/AmazonMp3GroupSource.cs b/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage/AmazonMp3GroupSource.cs
index 1041187..bd64778 100644
--- a/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage/AmazonMp3GroupSource.cs
+++ b/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage/AmazonMp3GroupSource.cs
@@ -45,7 +45,7 @@ namespace Banshee.Dap.MassStorage
             this.amazon_base_dir = amazon_base_dir;
 
             Properties.SetString ("Icon.Name", "amazon-mp3-source");
-            ConditionSql = String.Format ("(CoreTracks.Uri LIKE \"%{0}%\")", amazon_dir);
+            ConditionSql = String.Format ("(CoreTracks.FileLocation LIKE \"%{0}%\")", amazon_dir);
         }
 
         public override void Activate ()
diff --git a/src/Extensions/Banshee.CoverArt/Banshee.CoverArt/CoverArtJob.cs b/src/Extensions/Banshee.CoverArt/Banshee.CoverArt/CoverArtJob.cs
index c08d098..c479024 100644
--- a/src/Extensions/Banshee.CoverArt/Banshee.CoverArt/CoverArtJob.cs
+++ b/src/Extensions/Banshee.CoverArt/Banshee.CoverArt/CoverArtJob.cs
@@ -80,7 +80,7 @@ namespace Banshee.CoverArt
             );
 
             SelectCommand = new HyenaSqliteCommand (@"
-                SELECT DISTINCT CoreAlbums.AlbumID, CoreAlbums.Title, CoreArtists.Name, CoreTracks.Uri, CoreTracks.TrackID
+                SELECT DISTINCT CoreAlbums.AlbumID, CoreAlbums.Title, CoreArtists.Name, CoreTracks.FileLocation||CoreTracks.FileName, CoreTracks.TrackID
                     FROM CoreTracks, CoreArtists, CoreAlbums
                     WHERE
                         CoreTracks.PrimarySourceID = ? AND
diff --git a/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Data/PodcastSource.cs b/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Data/PodcastSource.cs
index 5f40955..71b41d3 100644
--- a/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Data/PodcastSource.cs
+++ b/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Data/PodcastSource.cs
@@ -102,7 +102,7 @@ namespace Banshee.Podcasting.Gui
             TrackArtworkIdHandler = GetTrackArtworkId;
             MediaTypes = TrackMediaAttributes.Podcast;
             NotMediaTypes = TrackMediaAttributes.AudioBook;
-            SyncCondition = "(substr(CoreTracks.Uri, 0, 4) != 'http' AND CoreTracks.PlayCount = 0)";
+            SyncCondition = "(substr(CoreTracks.FileLocation, 0, 4) != 'http' AND CoreTracks.PlayCount = 0)";
             TrackModel.Reloaded += OnReloaded;
 
             Properties.SetString ("Icon.Name", "podcast");
diff --git a/src/Libraries/Hyena/Hyena.Data.Sqlite/SqliteUtils.cs b/src/Libraries/Hyena/Hyena.Data.Sqlite/SqliteUtils.cs
index 5095a0d..36f3dd7 100644
--- a/src/Libraries/Hyena/Hyena.Data.Sqlite/SqliteUtils.cs
+++ b/src/Libraries/Hyena/Hyena.Data.Sqlite/SqliteUtils.cs
@@ -181,4 +181,22 @@ namespace Hyena.Data.Sqlite
             return Hyena.StringUtil.SearchKey (args[0] as string);
         }
     }
+
+
+    // for now, these 2 functions are only used in BansheeDbFormatMigrator
+    [SqliteFunction (Name = "HYENA_URI_TO_FILE_NAME", FuncType = FunctionType.Scalar, Arguments = 1)]
+    internal class UriToFileName : SqliteFunction
+    {
+        public override object Invoke (object[] args) {
+            return System.IO.Path.GetFileName ((string) args [0]);
+        }
+    }
+    [SqliteFunction (Name = "HYENA_URI_TO_FILE_LOCATION", FuncType = FunctionType.Scalar, Arguments = 1)]
+    internal class UriToFileLocation : SqliteFunction
+    {
+        public override object Invoke (object[] args) {
+            string uri = (string) args [0];
+            return uri.Substring (0, uri.Length - System.IO.Path.GetFileName (uri).Length);
+        }
+    }
 }
