[Date Prev][Date Next] [Chronological] [Thread] [Top]

direct MDB access for counting entries from Python



HI!

In my monitoring check I'd like to indicate how many entries are in a
database.

Currently I'm using the no-op search control without any filtering to
count the entries which is obviously a huge waste of CPU and I/O
ressources for just retrieving the raw number of DB entries.

Is it easily possible to access the id2e sub-DB and query number of entries?

Something like

mdb_stat -s id2e -e <db-path> | grep Entries

but from Python with python-lmdb or a similar module. (Yes, I know
subprocess module but I really hate invoking command-line tools from
Python.)

Ciao, Michael.