I was able to found the query from wfaguy.com.
posting here hoping someone can fidn it useful.
in regex input you can just put a whilecard for ex .*T1
where T1 is first two digits of policy name.
and at the end I put LIMIT 100 to list all policy but you can put it as 1 and thats the least used policy.
all creadit goes to wfaguy
SELECT
snapshot_policy.name,
vserver.name AS 'vserver.name',
cluster.primary_address AS 'vserver.cluster.primary_address',
count(volume.name)
FROM
cm_storage.snapshot_policy
LEFT JOIN
cm_storage.volume
ON volume.snapshot_policy_id=snapshot_policy.id
LEFT JOIN
cm_storage.vserver
ON snapshot_policy.vserver_id = vserver.id
LEFT JOIN
cm_storage.cluster
ON vserver.cluster_id = cluster.id
WHERE
snapshot_policy.name REGEXP '${regex}'
AND (
cluster.name = '${cluster_name}'
OR cluster.primary_address = '${cluster_name}'
)
AND vserver.name = '${vserver_name}'
GrOUp by
snapshot_policy.name,
vserver.name,
cluster.primary_address
ORDER BY
count(volume.name) LIMIT 100