Skip to main content

partition_plan

Function partition_plan 

Source
pub fn partition_plan(
    rete: &Rete,
    query: &str,
    var: &str,
) -> Result<PartitionPlan, SparqlError>
Expand description

Plan running query as many smaller queries, split by the values of var (?w, $w or w), so a long extraction can go in short chunks that each finish quickly and can be retried or resumed one by one.

Refused — SparqlError::Partition, saying why — when the chunks’ answers together would not be the query’s answer: an ASK or DESCRIBE, an ORDER BY, an aggregate not grouped by var, or a var some solution may leave unbound. Otherwise the plan carries the keys query, which lists the values to split (a superset: a value with no solution makes an empty chunk), and the top-level OFFSET/LIMIT the chunks drop and the caller applies once to the merged rows. Run each chunk with eval_query_partitioned.

Reads only the tile directory (to pick the cheapest pattern for the keys query), never tile data.