Compute a query hash from scan parameters.
(value_column: &str, start_ms: i64, end_ms: i64, bucket_interval_ms: i64)
| 134 | |
| 135 | /// Compute a query hash from scan parameters. |
| 136 | pub fn query_hash(value_column: &str, start_ms: i64, end_ms: i64, bucket_interval_ms: i64) -> u64 { |
| 137 | // no-determinism: query cache key, not WAL-affecting data |
| 138 | let mut hasher = DefaultHasher::new(); |
| 139 | value_column.hash(&mut hasher); |
| 140 | start_ms.hash(&mut hasher); |
| 141 | end_ms.hash(&mut hasher); |
| 142 | bucket_interval_ms.hash(&mut hasher); |
| 143 | hasher.finish() |
| 144 | } |
| 145 | |
| 146 | #[cfg(test)] |
| 147 | mod tests { |