clockworklabs / SpacetimeDB

Multiplayer at the speed of light
https://spacetimedb.com
Other
4.12k stars 100 forks source link

Store table row size in system table #1161

Open joshua-spacetime opened 3 weeks ago

joshua-spacetime commented 3 weeks ago

Ideally this would be a column in st_table, but I don't think we want to change the schema of st_table. It could also be a view over st_columns, but in that case we'd need to add an index to st_columns. The fastest, in terms of deriving the row size, is probably just to store it in a new system table. Perhaps the same one as https://github.com/clockworklabs/SpacetimeDB/issues/1158.

cloutiertyler commented 2 weeks ago

NOTE: This is presumably only the fixed len portion of the row?

Shubham8287 commented 2 weeks ago

Should we have ST_STATS for storing row size, row count, etc about a table?

joshua-spacetime commented 2 weeks ago

NOTE: This is presumably only the fixed len portion of the row?

Correct, specifically the BFLATN size.

Should we have ST_STATS for storing row size, row count, etc about a table?

Yes I think so.