# HG changeset patch # User Alain Mazy # Date 1791443718 -7200 # Node ID 35d32f786499f19ea944bc8bbfa9810244be2081 # Parent adb7b4290ab37c5c7b6e9b4c5048f2d3112ada57 temporarily disabled SQLite DB optimize/analyze diff -r adb7b4290ab3 -r 35d32f786499 OrthancServer/Sources/Database/SQLiteDatabaseWrapper.cpp --- 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(); }