private void accumulateNodeStatistics(TableStatistics stats, int bufferId) throws IOException {
		if (bufferId < 0) {
			return;
		}
		BTreeNode node = getBTreeNode(bufferId);
		++stats.bufferCount;

		int[] ids = node.getBufferReferences();

		if (node instanceof InteriorNode) {
			++stats.interiorNodeCnt;
			for (int id : ids) {
				accumulateNodeStatistics(stats, id);
			}
		}
		else {
			++stats.recordNodeCnt;
			for (int id : ids) {
				ChainedBuffer dbBuf = new ChainedBuffer(nodeMgr.getBufferMgr(), id);
				int cnt = dbBuf.getBufferCount();
				stats.chainedBufferCnt += cnt;
				stats.bufferCount += cnt;
			}
		}
		nodeMgr.releaseNodes(); // no need to hang on to buffers
	}
Accumulate node statistics (requires DBHandle lock)
@param stats statistics collection object
@param bufferId node buffer ID to examine
@throws IOException thrown if IO error occurs
Ghidra/Framework/DB/src/main/java/db/Table.java