# HG changeset patch # User Kim Alvefur # Date 1553217207 -3600 # Node ID 4803a25c7e366f1712664e33249cb94a3b8eea6d # Parent 147b28d001a06fddaf84bbdbd2a883bc358799ef mod_storage_sql: Cache total count if it's calculated as part of the current query diff -r 147b28d001a0 -r 4803a25c7e36 plugins/mod_storage_sql.lua --- a/plugins/mod_storage_sql.lua Fri Mar 22 02:12:02 2019 +0100 +++ b/plugins/mod_storage_sql.lua Fri Mar 22 02:13:27 2019 +0100 @@ -384,6 +384,9 @@ total = row[1]; end end + if query.start == nil and query.with == nil and query["end"] == nil and query.key == nil then + archive_item_count_cache:set(cache_key, total); + end if query.limit == 0 then -- Skip the real query return noop, total; end