Hashdb lookup optimization