Add an index on the e2eMangledName column in the metadata table
to speed up file sync by orders of magnitude on directories with
a large number of files.
Signed-off-by: Jan Schmidt <jan@centricular.com>
commitInternal("update database structure: add contentChecksum col for uploadinfo");
}
+ if (true) {
+ SqlQuery query(_db);
+ query.prepare("CREATE INDEX IF NOT EXISTS metadata_e2e_id ON metadata(e2eMangledName);");
+ if (!query.exec()) {
+ sqlFail("updateMetadataTableStructure: create index e2eMangledName", query);
+ re = false;
+ }
+ commitInternal("update database structure: add e2eMangledName index");
+ }
return re;
}