clockworklabs / SpacetimeDB

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

Redefine FieldName as `(TableId, ColId)` #1165

Closed Centril closed 2 weeks ago

Centril commented 2 weeks ago

Description of Changes

Do not store table names and field names in FieldName. Rather, store the table id and the column id which is substantially cheaper (8 bytes). Fixes a bug in fn column_pos along the way and does some drive-by cleanup.

The second commit adds both necessary changes to tests and refactoring around them, and similar changes which I had to do to understand and be confident in the changes to the tests. The diff got larger than I wanted, but once merged, I think it will help us long term.

Fixes https://github.com/clockworklabs/SpacetimeDB/issues/1118. Fixes https://github.com/clockworklabs/SpacetimeDB/issues/1117.

API and ABI breaking changes

None

Expected complexity level and risk

2