Tables which do not have primary keys allow inserting records with negative weights.
This could happen for example when replaying a CDC stream from some offset.
The SQL semantics is undefined for records with negative weights, and can lead to all sorts of weird behaviors or even runtime panics.
If a table is materialized without a primary key we could use the existing integral to detect whether a deleted row does not already exist and provide an informative error message. This should probably be directed by some property, because it's not cheap -- it will require a read on each insertion.
Tables which do not have primary keys allow inserting records with negative weights.
This could happen for example when replaying a CDC stream from some offset.
The SQL semantics is undefined for records with negative weights, and can lead to all sorts of weird behaviors or even runtime panics.
If a table is materialized without a primary key we could use the existing integral to detect whether a deleted row does not already exist and provide an informative error message. This should probably be directed by some property, because it's not cheap -- it will require a read on each insertion.