BUGFIX: avoid loops over huge vectors is StorageManagementDB 

make MySQL do an UNIQUE selection and use implicit loop, huge speed up for large results
To be forwarded to newer releases.