Row store vs column store
Your task
An analytics warehouse keeps one table in two layouts, row by row and column by column, and you are sizing the same scan against both. columns describes the table, one entry per column written as "name|width", where width is the bytes a single value of that column occupies, and column names are unique. row_count is how many rows the table holds. projected names the columns the query reads: a name may appear more than once, and a name that is not a column of this table is ignored. A row store has to read whole rows, so it reads row_count times the total width of every column. A column store opens only the files of the projected columns, so it reads row_count times the total width of the distinct projected columns that exist. Return a two element list, the row store bytes first and the column store bytes second.
Examples
projection_scan_bytes(columns: list[str], row_count: int, projected: list[str]) -> list[int]projection_scan_bytes(["event_id|8", "user_id|8", "country|2", "payload|512"], 1000, ["event_id", "country"])[530000, 10000]projection_scan_bytes(["event_id|8", "user_id|8", "country|2", "payload|512"], 1000, ["event_id", "user_id", "country", "payload"])[530000, 530000]projection_scan_bytes(["event_id|8", "user_id|8", "country|2", "payload|512"], 1000, ["payload", "payload", "missing"])[530000, 512000]