pub struct QueryHash { /* private fields */ }Expand description
A hash for uniquely identifying query execution units, to avoid recompilation of queries that have an open subscription.
Currently we are using a cryptographic hash, which is most certainly overkill. However the benefits include uniqueness by definition, and a compact representation for equality comparisons.
It also decouples the hash from the physical plan.
Note that we could hash QueryExprs directly, using the standard library’s hasher. However some execution units are comprised of several query plans, as is the case for incremental joins. And we want to associate a hash with the entire unit of execution, rather than an individual plan.
Implementations§
Source§impl QueryHash
impl QueryHash
pub fn from_bytes(bytes: &[u8]) -> Self
Sourcepub fn from_string(str: &str, identity: Identity, has_param: bool) -> Self
pub fn from_string(str: &str, identity: Identity, has_param: bool) -> Self
Generate a hash from a query string
Sourcepub fn from_string_and_identity(str: &str, identity: Identity) -> Self
pub fn from_string_and_identity(str: &str, identity: Identity) -> Self
If a query is parameterized with :sender, we must use the value of :sender,
i.e. the identity of the caller, when hashing the query text,
so that two identical queries from different clients aren’t hashed to the same value.
TODO: Once we have RLS, this hash must computed after name resolution. It can no longer be computed from the source text.
Trait Implementations§
Source§impl Ord for QueryHash
impl Ord for QueryHash
Source§impl PartialOrd for QueryHash
impl PartialOrd for QueryHash
impl Copy for QueryHash
impl Eq for QueryHash
impl StructuralPartialEq for QueryHash
Auto Trait Implementations§
impl Freeze for QueryHash
impl RefUnwindSafe for QueryHash
impl Send for QueryHash
impl Sync for QueryHash
impl Unpin for QueryHash
impl UnwindSafe for QueryHash
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more