VTgate service etcd service pod pod VTctld VTctld service Admin pod batch job VTgate pod Shard 1 Shard 2 tablet tablet Master Replica Ronly Master Replica Ronly PV PV
int) begin declare i int; set i = 0; set i = i + 1; INSERT INTO messages (page, time_created_ns, message) VALUES ( i, i+cast(now() as datetime) , SUBSTRING(MD5(RAND()), 1, 10)); end while; end ; call insert_messages(1000000); > select * from messages where message like '%abc%’; +----+-------------+----------+------------+- | id | select_type | table | partitions | +----+-------------+----------+------------+- | 1 | SIMPLE | messages | NULL | +----+-------------+----------+------------+-
• oltp_read_only.luaスクリプトを使用 • betweenはシャードをまたがって処理される 38 > select c from sbtest1 where id = :vtg1 > select c from sbtest1 where id = :vtg1 > select distinct c, weight_string(c) from sbtest1 where id between :vtg1 and :vtg2 order by c asc > select SUM(k) from sbtest1 where id between :vtg1 and :vtg2 > select c from sbtest1 where id between :vtg1 and :vtg2 > select c, weight_string(c) from sbtest1 where id between :vtg1 and :vtg2 order by c asc 1. Simple 2. Default