-
Notifications
You must be signed in to change notification settings - Fork 9.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
etcd clientv3 WithCountOnly performence #11036
Comments
Roughly speaking, it should be very fast compared to w/o this option. With Exact performance number depends on cluster configuration and hardware. |
and question is:
|
Yes. It is sorted by
In your test, ranging 500K keys takes longer than 2,500K keys?
I am not aware of any doc regarding implementation details of the index tree. The code is in mvcc package. And there is a brief description on etcd data model [2]. ref: Lines 327 to 328 in 9b29151
[2] https://github.com/etcd-io/etcd/blob/master/Documentation/learning/data_model.md |
thanks for your answer. its a mistake: correct is: |
the new question is:
|
It provides the same guarantee as a regular range request (by default range requests are linearizable reads, as opposed to serializable [1]). Your range result is guaranteed to see the latest finished mutating requests. During counting / ranging keys, the view of the data store is fixed.
Generally speaking, no. etcd supports 1 write + N reads. But there are caveats. I noticed you are using 3.3.10. Here are some of the improvements to backend concurrency since that version: #10523, #9296 |
Closing for now. Feel free to reopen if there are followup questions. |
I find following OpOption can get number of records in a range.
// WithCountOnly makes the 'Get' request return only the count of keys.
func WithCountOnly() OpOption {
return func(op *Op) { op.countOnly = true }
}
I'd like to know its performance. if i had 10w+ records in etcd, how long it take to calculate?
The text was updated successfully, but these errors were encountered: