Optimize search3, by removing OFFSET when paginating (#2655)
* Optimize pagination, removing offset * For search, don't add `where` clause for empty queries * Revert "Replace `COUNT(DISTINCT primary_key)` with `COUNT(*)`" Genres are required as part of the count queries, so filter by genres work * Optimize search3 query, using order by id if it is a "" query. Also fix the optimizePagination query logic * Allow offset optimizer threshold to be configured
This commit is contained in:
@@ -96,6 +96,7 @@ type configOptions struct {
|
||||
DevSidebarPlaylists bool
|
||||
DevEnableBufferedScrobble bool
|
||||
DevShowArtistPage bool
|
||||
DevOffsetOptimize int
|
||||
DevArtworkMaxRequests int
|
||||
DevArtworkThrottleBacklogLimit int
|
||||
DevArtworkThrottleBacklogTimeout time.Duration
|
||||
@@ -352,6 +353,7 @@ func init() {
|
||||
viper.SetDefault("devenablebufferedscrobble", true)
|
||||
viper.SetDefault("devsidebarplaylists", true)
|
||||
viper.SetDefault("devshowartistpage", true)
|
||||
viper.SetDefault("devoffsetoptimize", 50000)
|
||||
viper.SetDefault("devartworkmaxrequests", number.Max(2, runtime.NumCPU()/3))
|
||||
viper.SetDefault("devartworkthrottlebackloglimit", consts.RequestThrottleBacklogLimit)
|
||||
viper.SetDefault("devartworkthrottlebacklogtimeout", consts.RequestThrottleBacklogTimeout)
|
||||
|
||||
Reference in New Issue
Block a user