Skip to content
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

Usage question #376

Open
dineshbvadhia opened this issue Jan 12, 2025 · 2 comments
Open

Usage question #376

dineshbvadhia opened this issue Jan 12, 2025 · 2 comments

Comments

@dineshbvadhia
Copy link

My lmdb db has multiple tables to support mostly reads and few writes in operation.

However, 2 tables support an equal number of writes, reads and deletes. These tables are independent of the other tables in the db.

As performance is critical, would it be better to create a seperate lmdb db for these 2 tables?

@jnwatson
Copy link
Owner

Named databases in LMDB work by prepending the database name to each key in that databsae.

If you're more likely to access one table at a time, even for just a few records, it would be beneficial to separate them into 2 databases, as the cache is more likely to be warm for the BTree parent nodes that are shared among those common records.

@dineshbvadhia
Copy link
Author

dineshbvadhia commented Jan 13, 2025

@jnwatson Apologies, as I always state the lmdb terminology incorrectly.

The lmdb environment has max_dbs=N named databases.

Each of N-2 named databases are mostly reads with few writes.

Of the remaining 2, each have writes, reads and deletes spread equally (and operate independently of the N-2 named databases).

As performance is critical, would it be better to create a seperate lmdb environment for the 2 named databases?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants