# HG changeset patch # User Alain Mazy # Date 1727712156 -7200 # Node ID 4c84d908e89123ef5976cd47442b02a0f0d8a433 # Parent 58fce5aebb31b20489bcdbe6fb6b712738aad13c fix statistics in read-only diff -r 58fce5aebb31 -r 4c84d908e891 PostgreSQL/Plugins/SQL/PrepareIndex.sql --- a/PostgreSQL/Plugins/SQL/PrepareIndex.sql Fri Sep 27 18:49:10 2024 +0200 +++ b/PostgreSQL/Plugins/SQL/PrepareIndex.sql Mon Sep 30 18:02:36 2024 +0200 @@ -558,11 +558,11 @@ BEGIN - SELECT VALUE from GlobalIntegers + SELECT VALUE FROM GlobalIntegers INTO current_value WHERE key = statistics_key; - SELECT sum(value) + current_value FROM GlobalIntegersChanges + SELECT COALESCE(SUM(value), 0) + current_value FROM GlobalIntegersChanges INTO accumulated_value WHERE key = statistics_key;