30 lines
720 B
Python
Executable File
30 lines
720 B
Python
Executable File
#!/usr/bin/env python
|
|
import plyvel
|
|
import iavltree
|
|
from tqdm import tqdm
|
|
|
|
with plyvel.DB('../node/nodedir/data/application.db') as db:
|
|
height = iavltree.max_height(db)
|
|
|
|
total = iavltree.count(db, 's/k:emissions/', height, 'Qss', key = [62])
|
|
progress = tqdm(total = total)
|
|
|
|
it = iavltree.iterate(db, 's/k:emissions/', height, 'Qss', key = [62])
|
|
|
|
for k, v in it:
|
|
progress.update(1)
|
|
|
|
progress.close()
|
|
|
|
keys = it.inner.lookups
|
|
|
|
print(f'Number of items: {total}')
|
|
print(f'Lookups needed: {len(keys)}')
|
|
|
|
with plyvel.DB('../node/nodedir/data/application.db') as db:
|
|
progress = tqdm(total = len(keys))
|
|
for k in keys:
|
|
db.get(k)
|
|
progress.update(1)
|
|
progress.close()
|