Closed sinmetal closed 6 years ago
Q:セカンダリが多いとinsert/delete遅くなる? A:貼る時に時間はかかるけど、多いからと言って遅くなるかというとそういうわけではない。
GCPUG ShonanでRobertに聞いたら、以下のように言ってた。
INDEXが0 か 1以上でCPU利用率とPerformanceは変わる。そこから100個ぐらいまでは変わらないだろう。1000ぐらいまでいくと変わるかもしれない。
Paxos Groupの数で変わるので、CPU利用率やPerformanceが変わるのは、階段状になる
セカンダリインデックスはどのように設計するのがよいだろうか?
WHAT
Does INSERT, DELETE slow if I set a lot of secondary indexes?
Shared is indispensable for index to monotonically increasing value?
セカンダリインデックスをたくさん設定すると、INSERT, DELETEが遅くなる?
単調増加する値へのインデックスはSharedが必須?
Set Shard and perform a full scan if you do a simple query
It is quick if you acquire LIMIT by shard for each shard and rearrange
WHY
Refs
https://cloudplatform.googleblog.com/2018/05/Sharding-of-timestamp-ordered-data-in-Cloud-Spanner.html