Re: Data Structure for use vs storage

"David McClain (as dbm at refined-audiometrics dot com)" <[email protected]>
Newsgroups gmane.lisp.lispworks.general
Message-ID <[email protected]>
> In addition to a hashtable, you can maintain a BTree index on a "primary key" column. That would considerably speed up queries like this:
> 
> (bplustree-search-range 501 1000 *my-tree*)
> 


Yes, true. But there again you are assuming an ordering relation for the key.

And to avoid problems with multiprocessing, I would instead use a purely functional Red-Black tree.

Why Red-Black? Well you’d have to ask the computer scientists that invented the OCaml standard library. I just translated what they provided there into Lisp. (IOW, I cheated…)

But purely functional has huge advantages in the face of parallel and multiple thread concurrent access. And no locks needed.



> On Feb 18, 2026, at 00:17, Dmitry Ivanov (as ystok-systema at mail dot ru) <[email protected]> wrote:
> 
> David McClain (as dbm at refined-audiometrics dot com) wrote:
> 
>> I looked at the BTree code. Interesting. But when would you use this over the built-in Hashtables of Common Lisp? In fact, with Hashtables, you don’t even need an ordering to the underlying data, just an equality comparison.
> 
> In addition to a hashtable, you can maintain a BTree index on a "primary key" column. That would considerably speed up queries like this:
> 
> (bplustree-search-range 501 1000 *my-tree*)
> 
> -- 
> Dmitry Ivanov
> lisp.ystok.ru
> 
> _______________________________________________
> Lisp Hug - the mailing list for LispWorks users
> [email protected]
> http://www.lispworks.com/support/lisp-hug.html


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
[email protected]
http://www.lispworks.com/support/lisp-hug.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.