如下最后结果, keys 没有均匀分布在各个region
select count(1) from customer2; – 25000
select min(_tidb_rowid),max(_tidb_rowid) from customer2; – 8646911284551352321 , 8646911284551377320
split table customer2 between (8646911284551352321) and (8646911284551377320) regions 16;
SELECT
c.address,
sum(APPROXIMATE_KEYS),
count(1)
FROM
INFORMATION_SCHEMA.TIKV_REGION_STATUS s
JOIN INFORMATION_SCHEMA.TIKV_REGION_PEERS p ON s.REGION_ID = p.REGION_ID
JOIN INFORMATION_SCHEMA.TIKV_STORE_STATUS C ON P.store_id = c.store_id
WHERE
TABLE_NAME = ‘customer2’
AND p.is_leader = 1
AND APPROXIMATE_KEYS > 0
AND is_index = 0
group by c.address
order by 1;
±---------------------±----------------------±---------+
| address | sum(APPROXIMATE_KEYS) | count(1) |
±---------------------±----------------------±---------+
| 192.168.145.82:20160 | 8597 | 6 |
| 192.168.145.83:20160 | 19778 | 6 |
| 192.168.145.84:20160 | 8170 | 6 |
±---------------------±----------------------±---------+
3 rows in set (0.10 sec)