1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-08 07:07:05 +02:00

Speed up NetworkActivity by joining fewer rows

This commit is contained in:
Uwe L. Korn
2013-07-29 20:20:38 +02:00
parent a21213cfcd
commit 031bd3a0b1
2 changed files with 2 additions and 0 deletions

View File

@@ -80,6 +80,7 @@ DatabaseCommand_TrendingArtists::exec( DatabaseImpl* dbi )
" WHERE playback_log.source IS NOT NULL " // exclude self
" AND playback_log.playtime >= %1 AND playback_log.playtime <= %2 "
" GROUP BY track.artist "
" HAVING counter > 0 "
);
QString lastWeekSql = timespanSql.arg( _1WeekAgo.toTime_t() ).arg( now.toTime_t() );
QString _1BeforeLastWeekSql = timespanSql.arg( _2WeeksAgo.toTime_t() ).arg( _1WeekAgo.toTime_t() );

View File

@@ -81,6 +81,7 @@ DatabaseCommand_TrendingTracks::exec( DatabaseImpl* dbi )
" WHERE playback_log.source IS NOT NULL " // exclude self
" AND playback_log.playtime >= %1 AND playback_log.playtime <= %2 "
" GROUP BY playback_log.track "
" HAVING counter > 0 "
);
QString lastWeekSql = timespanSql.arg( _1WeekAgo.toTime_t() ).arg( now.toTime_t() );
QString _1BeforeLastWeekSql = timespanSql.arg( _2WeeksAgo.toTime_t() ).arg( _1WeekAgo.toTime_t() );