From 97f5b41e5cc778239ab1b4d7a20ae3c47a80bbb0 Mon Sep 17 00:00:00 2001 From: Matt Ranostay Date: Thu, 29 Mar 2018 09:50:28 -0700 Subject: binding: mediascanner: optimize audio sql query Convert query to use INNER JOIN for the audios table Change-Id: I9c0b91ef4289ca66322aa805198873e4043f8f92 Signed-off-by: Matt Ranostay --- binding/media-manager.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'binding') diff --git a/binding/media-manager.h b/binding/media-manager.h index 200b43d..4b381dc 100644 --- a/binding/media-manager.h +++ b/binding/media-manager.h @@ -77,15 +77,15 @@ void DebugTraceSendMsg(int level, gchar* message); #define AUDIO_SQL_QUERY \ "SELECT files.path, audios.title, audio_artists.name, " \ "audio_albums.name, audio_genres.name, audios.length " \ - "FROM files LEFT JOIN audios " \ + "FROM files INNER JOIN audios " \ + "ON files.id = audios.id " \ "LEFT JOIN audio_artists " \ "ON audio_artists.id = audios.artist_id " \ "LEFT JOIN audio_albums " \ "ON audio_albums.id = audios.album_id " \ "LEFT JOIN audio_genres " \ "ON audio_genres.id = audios.genre_id " \ - "WHERE audios.id = files.id " \ - "AND files.path LIKE '%s/%%' " \ + "WHERE files.path LIKE '%s/%%' " \ "ORDER BY " \ "audios.artist_id, audios.album_id, audios.trackno" -- cgit 1.2.3-korg