[Date Prev][Date Next]
Accessing random rows from LMDB
- To: firstname.lastname@example.org
- Subject: Accessing random rows from LMDB
- From: Sravan Kumar Reddy Javaji <email@example.com>
- Date: Mon, 9 Feb 2015 11:16:34 -0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=Ewth7Y7iAyjf2tDZndl4eV9NTG1Cfxx/gEqTIFZcanI=; b=aLQIF3w3u8LLLT7mi4LrB5M+P+Wxy4Iqg4cYYYEmLkqKy9byvJNJO7o4ypQT+j2rDh ae3B7tmyf+2ETCLwv+G851xsDr/W57f4ubukV8GoDX3OccIbKE9YkoUo3ql8pgD5zNET jEqA6wfgOph5fR7xKkJUYm6GoGhYZyWtSJWds2jh/wtB38jJUlHCNGdv9uD9MHU5MHOL UlD9Ze9QN2QPtCez27nM3VY8jA1IYLoRtuDpjyUFKUGtwEKDBTgwHVca0vdCrP74i6LJ vTsHFmKoc0DV/coj5Rsuy914pCmZP2MrzFs5MmkdgRtFOA47VMFISP/Z18tgdVY9bcB0 PHEg==
I am new to LMDB. I have couple of questions,
1) Is there anyway that I can find the total number of records in LMDB.
2) Can I access all the rows from LMDB randomly instead of sequentially. For example, if there are 10 rows in LMDB as shown below,
I want to access it randomly, something like shown below
I know that it is better to read sequentially from LMDB and then later randomize the records. But I have around 1 million records in LMDB, I cant upload entire data to memory at once. I am planning to read data batch wise into memory and perform some operation on it. So, I am wondering, is there anyway that I can read the data randomly from LMDB directly.
Looking forward to hear from you