tidwall / buntdb

BuntDB is an embeddable, in-memory key/value database for Go with custom indexing and geospatial support
MIT License
4.57k stars 289 forks source link

How to get all keys without order by? #66

Closed smartaquarius10 closed 3 years ago

smartaquarius10 commented 3 years ago

Team,

Is there anyway to read all the key/values in the same way we perform this query in any database but without using ascend or descend because sorting unnecessary makes a performance hit

select * from table

Does blunt db supports such behavior?

tidwall commented 3 years ago

BuntDB does not have tables. It's a database with single set of key/value items ordered by the key of each item. The Ascend does not perform ordering, because the data is already ordered. It just scans each item, one after another.

It's fast.

Under the hood, BuntDB uses a B-tree for storing data, and scanning a B-tree data is probably the fastest scan you can get from any type of tree-based data structure.