Add docSize(id) to transaction
Review Request #124063 - Created June 10, 2015 and discarded
This method tries to approximate the space a file's data is taking in the index.
balooctl status [file..] now also shows this information.
The method of calculation of the document size isn't very accurate.
- It's quite hard to approximate the size used by the postingDB + positionDB.
- For the PostingDB you are using 64 bytes. I'm not sure how that translates.
For the PositionDB it's even more complex. Also, when/if the PositionCodec implementation changes, the current code breaks.
For the other databases, we actually need to take the pagesize of the db and the header size into consideration, since they also consume space. Also there is a concept of overflow pages. All of this is generally taken care of by the MDB_stat method. But doing it per document will be hard.
Maybe you could drop this for now and focus on other stuff?