Use 64-bit names for temporary tables
Имена для временных таблиц на стородже генерируются с помощью 32-битного murmur хэша. Вероятность коллизии довольно высокая (см. tarantool#59), так что лучше использовать 64-битный хэш для временных таблиц.
/// Generate a temporary table name for the specified motion node.
#[must_use]
pub fn table_name(plan_id: &str, node_id: NodeId) -> SmolStr {
let base = {
#[cfg(feature = "mock")]
{
format_smolstr!("TMP_{plan_id}")
}
#[cfg(not(feature = "mock"))]
{
use hash32::{Hasher, Murmur3Hasher};
let mut hasher = Murmur3Hasher::default();
hasher.write(plan_id.as_bytes());
let id = hasher.finish();
format_smolstr!("TMP_{id}")
}
};
format_smolstr!("{base}_{node_id}")
}
Edited by Denis Smirnov