Skip to main content

Module graph

Module graph 

Source
Expand description

Building a table’s graph sections from the table’s own columns.

This is where the two halves meet. rudb-graph at rank 5 knows what a key map is and knows nothing about a file; the rest of this crate knows how to put an opaque payload in a file and nothing about what one means. Neither of them can build a key map for a real table, because doing that means reading a column back, so it happens here, in the crate that is allowed to see both.

Everything here obeys spec/graph/03-the-file-format.md section 3.1. A column that cannot be mapped is a column with no key map, not an error at open; a section that is stale, torn, or of a form this build does not know is a section that is not there. That is why key_map answers with an Option and not a Result: there is no failure it could report that is not answered by running the query the way it ran before the section existed.

Structs§

Built
What building one key map cost and what it bought.
BuiltLink
What building one forward link cost and what it bought.
Edge
One relationship, with both sides resolved to a table and a column of it.
KeyColumn
One column of a committed table, scanned in rid order.

Constants§

ADJACENCY_SHARE
The share of a table’s stored column bytes its adjacencies are allowed to cost together.
BUDGET_FLOOR
The size below which a table’s graph sections always fit, whatever the share works out to.
BUDGET_SHARE
The share of a table’s stored column bytes its graph sections are allowed to cost together.
KEY_MAP_SHARE
The share of a table’s stored column bytes its key maps are allowed to cost together.

Functions§

build_key_map
Builds the key map for one column of a committed table.
build_key_maps
Builds a key map for each of these columns and attaches them all in one commit.
build_key_maps_within
The same, against a budget of share percent of the table’s stored column bytes.
build_links
Builds a forward link for each relationship and attaches each child table’s in one commit.
build_links_within
The same, against a budget of share percent of each child table’s stored column bytes.
columns_of
The columns a key number names, which key_of made.
holds_key_map
Whether this table holds a key map over this column at its current generation.
key_map
The key map this table carries for a column, when it carries one this build can use.
key_of
The number that names a key over these columns, or None for a list this cannot name.
link_parent
The parent table and column the current forward link for this child column was built against.
pair
The two columns of a pair key, first then second.
refused_key_map
What a key map over this column would have cost, when a build measured one and did not keep it.
refused_link
What a forward link for this column would have cost, when a build measured one and did not keep it. The counterpart of stored_link, the way refused_key_map is the counterpart of key_map.
shared_adjacency
stored_adjacency, decoded once per open table and parent. See Decoded.
shared_key_map
key_map, decoded once per open table. See Decoded.
shared_link
stored_link, decoded once per open table and parent. See Decoded.
stored_adjacency
The backward adjacency this child table carries for a column, under the same rules as stored_link: current, bound to the parent being asked about, and readable, or nothing.
stored_degrees
What the build measured of a relationship’s shape, when the child table carries it.
stored_link
The forward link this child table carries for a column, when it carries one this build can use and the parent it was built against is still the parent being asked about.
stored_link_counts
The counts at the front of the stored link stored_link would return, read without the link.