comparison PostgreSQL/Plugins/PostgreSQLIndex.cpp @ 19:38e23471d132

more visibility on the index creation
author am@osimis.io
date Tue, 10 Jul 2018 11:05:37 +0200
parents dfc7002add9c
children aacb651833f5
comparison
equal deleted inserted replaced
15:dfc7002add9c 19:38e23471d132
127 * https://www.postgresql.org/docs/current/static/pgtrgm.html 127 * https://www.postgresql.org/docs/current/static/pgtrgm.html
128 * https://bitbucket.org/sjodogne/orthanc/issues/47/index-improvements-for-pg-plugin 128 * https://bitbucket.org/sjodogne/orthanc/issues/47/index-improvements-for-pg-plugin
129 **/ 129 **/
130 try 130 try
131 { 131 {
132 LOG(INFO) << "Trying to enable trigram matching on the PostgreSQL database to speed up wildcard searches. This may take several minutes"; // we've observed 9 minutes on DB with 100000 studies 132 LOG(WARNING) << "Trying to enable trigram matching on the PostgreSQL database to speed up wildcard searches. This may take several minutes"; // we've observed 9 minutes on DB with 100000 studies
133 db->Execute( 133 db->Execute(
134 "CREATE EXTENSION pg_trgm; " 134 "CREATE EXTENSION pg_trgm; "
135 "CREATE INDEX DicomIdentifiersIndexValues2 ON DicomIdentifiers USING gin(value gin_trgm_ops);"); 135 "CREATE INDEX DicomIdentifiersIndexValues2 ON DicomIdentifiers USING gin(value gin_trgm_ops);");
136 136
137 SetGlobalIntegerProperty(*db, t, Orthanc::GlobalProperty_HasTrigramIndex, 1); 137 SetGlobalIntegerProperty(*db, t, Orthanc::GlobalProperty_HasTrigramIndex, 1);
138 LOG(WARNING) << "Trigram index has been created";
138 } 139 }
139 catch (Orthanc::OrthancException&) 140 catch (Orthanc::OrthancException&)
140 { 141 {
141 LOG(WARNING) << "Performance warning: Your PostgreSQL server does not support trigram matching"; 142 LOG(WARNING) << "Performance warning: Your PostgreSQL server does not support trigram matching";
142 LOG(WARNING) << "-> Consider installing the \"pg_trgm\" extension on the PostgreSQL server, e.g. on Debian: sudo apt install postgresql-contrib"; 143 LOG(WARNING) << "-> Consider installing the \"pg_trgm\" extension on the PostgreSQL server, e.g. on Debian: sudo apt install postgresql-contrib";