pub struct SelectRows { /* private fields */ }Expand description
A SELECT answered to the id level: the variables and every solution row
as dictionary ids, with no term decoded for output. SelectRows::len is
the exact row count; SelectRows::page decodes one window of rows on
demand, as one batch of dictionary chunk reads. Built by
eval_select_rows.
What the query itself needed has been decoded: the keys an ORDER BY
sorts on (none, when the file is 0x08 and the key is a plain variable
of an order-exact group: ids sort), the values a FILTER or an aggregate reads. Every other column
of every row stays an id until a page asks for it, so a result of 650,000
rows costs the terms of the page shown, not of the result. DISTINCT and
GROUP BY already work on ids.
The rows are only meaningful against the Rete that produced them.
Implementations§
Source§impl SelectRows
impl SelectRows
Sourcepub fn warnings(&self) -> &[QueryWarning]
pub fn warnings(&self) -> &[QueryWarning]
The diagnostics the query raised, as eval_query_with_warnings reports
them (the type errors a FILTER absorbed, a case-sensitivity hint for an
empty result).
Sourcepub fn vars(&self) -> &[String]
pub fn vars(&self) -> &[String]
The projected variables (for SELECT *, every variable some row binds,
in name order), the keys of every row page returns.
Sourcepub fn page(
&self,
rete: &Rete,
offset: usize,
limit: usize,
) -> Vec<BTreeMap<String, String>>
pub fn page( &self, rete: &Rete, offset: usize, limit: usize, ) -> Vec<BTreeMap<String, String>>
Rows offset..offset + limit (fewer at the end, none past it) decoded
to term tokens, an unbound variable left out of its row, exactly as
eval_query returns them. The dictionary chunks the window needs are
faulted in one batch first. rete must be the file the rows came from.
Trait Implementations§
Source§impl Clone for SelectRows
impl Clone for SelectRows
Source§fn clone(&self) -> SelectRows
fn clone(&self) -> SelectRows
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more