select array.name as Array, volume.name as Volume, volume.discovery_timestamp FROM storage.volume left join storage.array on volume.array_id = array.id left join storage.vfiler on volume.vfiler_id = vfiler.id and volume.id != vfiler.root_volume_id left join storage.cifs_share on array.id = cifs_share.array_id AND cifs_share.actual_path like CONCAT('/vol/', volume.name, '%') left join storage.nfs_export on volume.id = nfs_export.volume_id left join storage.lun on volume.id = lun.volume_id AND ( lun.mapped = '1' AND lun.is_online = '1' ) left join storage.vsm on volume.id = vsm.secondary_volume_id where lun.id is null AND nfs_export.id is null AND cifs_share.id is null AND vsm.id is null AND volume.state = 'online'