changeset 7168:35d32f786499

temporarily disabled SQLite DB optimize/analyze
author Alain Mazy <am@orthanc.team>
date Thu, 08 Oct 2026 09:15:18 +0200
parents adb7b4290ab3
children 47f2edc0200d
files OrthancServer/Sources/Database/SQLiteDatabaseWrapper.cpp
diffstat 1 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancServer/Sources/Database/SQLiteDatabaseWrapper.cpp	Wed Oct 07 16:39:34 2026 +0200
+++ b/OrthancServer/Sources/Database/SQLiteDatabaseWrapper.cpp	Thu Oct 08 09:15:18 2026 +0200
@@ -2900,8 +2900,8 @@
           ExecuteEmbeddedScript(db_, ServerResources::INSTALL_ATTACHED_FILES_UUID_INDEX);
         }
 
-        // New in Orthanc 1.13.1 run optimize at each startup, provided there are enough data to perform a relevant analysis
-        Optimize(false);
+        // // New in Orthanc 1.13.1 run optimize at each startup, provided there are enough data to perform a relevant analysis
+        // Optimize(false);
       }
 
       transaction->Commit(0);
@@ -3054,14 +3054,14 @@
   void SQLiteDatabaseWrapper::FlushToDisk()
   {
     boost::recursive_mutex::scoped_lock lock(mutex_);
-    static bool hasRunOptimizeOnce = false;
-
-    if (!hasRunOptimizeOnce)
-    {
-      // This will run ANALYZE only once whe the Resources table contains reaches a predefined size and if there are no index statistics yet.
-      // Then, an OPTIMIZE step will run at each startup (and will execute ANALYZE if it makes sense)
-      hasRunOptimizeOnce = Optimize(true /* onlyIfStatsDontExistsYet */);
-    }
+    // static bool hasRunOptimizeOnce = false;
+
+    // if (!hasRunOptimizeOnce)
+    // {
+    //   // This will run ANALYZE only once whe the Resources table contains reaches a predefined size and if there are no index statistics yet.
+    //   // Then, an OPTIMIZE step will run at each startup (and will execute ANALYZE if it makes sense)
+    //   hasRunOptimizeOnce = Optimize(true /* onlyIfStatsDontExistsYet */);
+    // }
 
     db_.FlushToDisk();
   }