Profile - metadata: optimization of cleaning queries