knowsys / nemo

A fast in-memory rule engine
https://knowsys.github.io/nemo-doc/
Apache License 2.0
84 stars 7 forks source link

Add counting of rows in on-disk tables #335

Open rlwww opened 1 year ago

rlwww commented 1 year ago

See https://github.com/knowsys/nemo/blob/4696a32b9f67a040df4268c9c7ea65dafecf89ec/nemo-physical/src/management/database.rs#L386-L396

mmarx commented 1 year ago

Getting exact counts will require duplicate elimination (and at that point we basically have an in-memory table). Is a rough estimate enough here?

monsterkrampe commented 2 months ago

It seems like we do not necessarily need row counts for tables not in memory. Maybe we can just rename this and return an Option(?)

pub fn count_rows_if_in_memory(&self, id: &TableId) -> Option<usize> {...}

or even just the following keeping the current behavior

pub fn count_rows_in_memory(&self, id: &TableId) -> usize {...}

For me. this depends on how this function is used elsewhere.