Alex Rivera | Logout

How to get the exact number of keys in leveldb fast?

Asked 2012-11-16T14:50:29.063
16

It seems there's not such interface..

Do I have to iterate all keys to get the count?

What is the design purpose of that? Or what is the limitation of implement this feature?

Edit
Report

1 Answer

15

"There is no way to implement Count more efficiently inside leveldb than outside." states offical issue 113

Looks like there is no better way to do it, except for either iterating through the whole dataset or implementing your own in-application on-write counter.

answered 2012-12-11T09:04:42.350

Your Answer