···188188 break;
189189 }
190190191191- let rkey: DbRkey = rmp_serde::from_slice(&key[prefix.len()..]).into_diagnostic()?;
191191+ // manual deserialization of the key suffix since it is raw bytes, not msgpack
192192+ let suffix = &key[prefix.len()..];
193193+ let rkey = if suffix.len() == 8 {
194194+ let mut bytes = [0u8; 8];
195195+ bytes.copy_from_slice(suffix);
196196+ DbRkey::Tid(crate::db::types::DbTid::new_from_bytes(bytes))
197197+ } else {
198198+ let s = String::from_utf8_lossy(suffix);
199199+ DbRkey::Str(smol_str::SmolStr::from(s.as_ref()))
200200+ };
201201+192202 // look up using binary cid bytes from the record
193203 if let Ok(Some(block_bytes)) = blocks_ks.get(&cid_bytes) {
194204 let val: Data = serde_ipld_dagcbor::from_slice(&block_bytes).unwrap_or(Data::Null);