pub struct Layout {
pub file: u64,
pub rows: usize,
pub stripes: usize,
pub parts: usize,
pub columns: Vec<ColumnLayout>,
pub indexes: u64,
pub directory: u64,
pub header: u64,
}Expand description
Where a whole file’s bytes went.
Every number here comes out of the committed directory, so taking it costs one directory read however large the file is. That is the point: a 45 GB table has to be able to say where it went without being read, or nobody will ask.
The parts that are not a column are kept apart rather than shared out over the columns. The stripe index page holds a section per column and could be split, and the directory and the header cannot be, so splitting one of the three and not the others would read as if the columns accounted for everything. They do not, and the gap is the thing worth looking at.
Fields§
§file: u64The size of the file on disk.
rows: usizeCommitted rows.
stripes: usizeCommitted stripes.
parts: usizeCommitted parts, which is how many chunks a scan reads.
columns: Vec<ColumnLayout>One entry per column, in the table’s column order.
indexes: u64Every stripe’s index page, which carries a length and a checksum for every part of every column and is charged per stripe rather than per column.
directory: u64The committed directory itself, the one that was read to build this.
header: u64The fixed header, which holds the magic, the format and the two directory slots.
Implementations§
Source§impl Layout
impl Layout
Sourcepub fn columns_total(&self) -> u64
pub fn columns_total(&self) -> u64
Everything the columns cost together.
Sourcepub fn unaccounted(&self) -> u64
pub fn unaccounted(&self) -> u64
What the file holds that this does not account for.
A committed file is written once and never rewritten in place, so an earlier directory and the pages of an earlier snapshot are still in it. That is the honest place for them: they are bytes on disk that no column owns.