[to v6r10] BUGFIX: speed up File Metadata searches and fix problem with locks

let MySQL do the work