select TABLE_ID, p.STORE_ID, ADDRESS, count(p.REGION_ID)
from information_schema.tikv_region_status r, information_schema.tikv_region_peers p, information_schema.tikv_store_status s
where r.db_name = 'db_x' and r.table_name = 't_x'
and r.region_id = p.region_id and p.store_id = s.store_id and json_extract(s.label, "$[0].value") = "tiflash"
group by TABLE_ID, p.STORE_ID, ADDRESS;