[add] heavy query caching, [add] wpm leaderboard

This commit is contained in:
2023-10-03 16:47:38 -04:00
parent 5cd4e165b0
commit 752741a2eb
11 changed files with 573 additions and 356 deletions

View File

@@ -75,7 +75,7 @@ local STATISTICS_ACTIVITY_SINCE_QUERY = [[
JOIN book AS b
ON b.id = psd.id_book
WHERE start_time > %d
ORDER BY start_time ASC LIMIT 1000;
ORDER BY start_time ASC LIMIT 5000;
]]
local STATISTICS_BOOK_QUERY = [[
@@ -907,7 +907,7 @@ function SyncNinja:getStatisticsActivity(timestamp)
local conn = SQ3.open(statistics_db)
local stmt = conn:prepare(string.format(STATISTICS_ACTIVITY_SINCE_QUERY,
timestamp))
local rows = stmt:resultset("i", 1000)
local rows = stmt:resultset("i", 5000)
conn:close()
-- No Results