[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Question about MDB_INTEGERKEY flag
- To: openldap-technical@openldap.org
- Subject: Question about MDB_INTEGERKEY flag
- From: Greg Heinrich <gregory.heinrich@gmail.com>
- Date: Fri, 15 Apr 2016 21:33:47 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to; bh=oLyZZ0DY4YybplRy+Qvg2ybhvp5GM2K7UCgSwBIjn38=; b=Lu0K7JmI/xiJdD705UH0loXr5AGnXOi1cdWO+C5kLxwQBwb4aejWOsf1zK9HIw/4Z+ 6yIH0l0FMoaY/fc8zns0nyyAkR32gyup4cmz+mPQtPmZeEzMb4vHeU8/HB7OKvhOdmuE /rDFzxVByl/r6gFv29LWU/CvJIHL3vGxrgET76rZ3ShYkXqw497ZouIFk7KLLA534OL6 LFFzg7MXWZrzqcICUChc6CnS/our2OPW0JdTW0x/fKZZondmJ/AQtg6z6PU7381n/ZYl dSIWERkCk5iApPv6lz6/zrEtueAA+qnKzHoYhqA5bnRTD7EViukEUh8YoXk+Ml2o4nNK v5ig==
Hello,
sorry for being a noob but I have a question regarding the MDB_INTEGERKEY flag.
I am using the LMDB library through Lua wrappers from
https://github.com/shmul/lightningmdb.
I have an LMDB file which was created with keys that are named "key0",
"key1", ...
When I open the database with mdb_dbi_open(txn, NULL, MDB_INTEGERKEY,
& dbi) and enumerate keys with successive calls to
mdb_cursor_get(cursor, &key, &val, MDB_NEXT) the key values that I
read are the same as in the LMDB (i.e. "key0", ...). Since I am using
the MDB_INTEGERKEY flag I was hoping to read keys as 1,2,3, etc. And I
thought I would then be able to retrieve entries doing e.g.
mdb_get(txn, dbi, "1", &data).
Am I doing anything wrong or is MDB_INTEGERKEY just used to enforce
integer keys when putting entries?
To give my question some background: what I am trying to achieve is to
read entries in my LMDB file in random/arbitrary order. Since I have
may 10 million entries or more, I do not want to store keys in memory.
I'd rather retrieve entries using an index. Is that possible? Note
that I do not have control over the key naming convention so keys
could be named anything.
Thanks!
Greg.