Mercurial > hg > orthanc-databases
comparison PostgreSQL/Plugins/PostgreSQLIndex.cpp @ 473:15e609c439d1
Fixed the MaximumStorageSize & MaximumPatientCount.
author | Alain Mazy <am@osimis.io> |
---|---|
date | Wed, 14 Feb 2024 13:46:04 +0100 |
parents | ff84104f7842 |
children | 0974a58fdc76 |
comparison
equal
deleted
inserted
replaced
472:d1e1cb3ab741 | 473:15e609c439d1 |
---|---|
238 uint64_t result; | 238 uint64_t result; |
239 | 239 |
240 { | 240 { |
241 DatabaseManager::CachedStatement statement( | 241 DatabaseManager::CachedStatement statement( |
242 STATEMENT_FROM_HERE, manager, | 242 STATEMENT_FROM_HERE, manager, |
243 "SELECT value FROM GlobalIntegers WHERE key = 0"); | 243 "SELECT * FROM UpdateSingleStatistic(0)"); |
244 | 244 |
245 statement.SetReadOnly(true); | |
246 statement.Execute(); | 245 statement.Execute(); |
247 | 246 |
248 result = static_cast<uint64_t>(statement.ReadInteger64(0)); | 247 result = static_cast<uint64_t>(statement.ReadInteger64(0)); |
249 } | 248 } |
250 | 249 |
260 uint64_t result; | 259 uint64_t result; |
261 | 260 |
262 { | 261 { |
263 DatabaseManager::CachedStatement statement( | 262 DatabaseManager::CachedStatement statement( |
264 STATEMENT_FROM_HERE, manager, | 263 STATEMENT_FROM_HERE, manager, |
265 "SELECT value FROM GlobalIntegers WHERE key = 1"); | 264 "SELECT * FROM UpdateSingleStatistic(1)"); |
266 | 265 |
267 statement.SetReadOnly(true); | |
268 statement.Execute(); | 266 statement.Execute(); |
269 | 267 |
270 result = static_cast<uint64_t>(statement.ReadInteger64(0)); | 268 result = static_cast<uint64_t>(statement.ReadInteger64(0)); |
271 } | 269 } |
272 | 270 |
620 OrthancPluginResourceType_Instance == 3); | 618 OrthancPluginResourceType_Instance == 3); |
621 | 619 |
622 uint64_t result; | 620 uint64_t result; |
623 | 621 |
624 { | 622 { |
625 DatabaseManager::CachedStatement statement( | 623 DatabaseManager::StandaloneStatement statement( |
626 STATEMENT_FROM_HERE, manager, | 624 manager, |
627 "SELECT value FROM GlobalIntegers WHERE key = ${key}"); | 625 std::string("SELECT * FROM UpdateSingleStatistic(") + boost::lexical_cast<std::string>(resourceType + 2) + ")"); // For an explanation of the "+ 2" below, check out "PrepareIndex.sql" |
628 | 626 |
629 statement.SetParameterType("key", ValueType_Integer64); | 627 statement.Execute(); |
630 | |
631 Dictionary args; | |
632 | |
633 // For an explanation of the "+ 2" below, check out "FastCountResources.sql" | |
634 args.SetIntegerValue("key", static_cast<int>(resourceType + 2)); | |
635 | |
636 statement.SetReadOnly(true); | |
637 statement.Execute(args); | |
638 | 628 |
639 result = static_cast<uint64_t>(statement.ReadInteger64(0)); | 629 result = static_cast<uint64_t>(statement.ReadInteger64(0)); |
640 } | 630 } |
641 | 631 |
642 // disabled because this is not alway true while transactions are being executed in READ COMITTED TRANSACTION. This is however true when no files are being delete/added | 632 // disabled because this is not alway true while transactions are being executed in READ COMITTED TRANSACTION. This is however true when no files are being delete/added |