Sample Header Ad - 728x90

What happens to the n tables you insert into during a transaction?

0 votes
1 answer
307 views
With a database structure sort of like [this](https://dba.stackexchange.com/questions/315123/how-to-have-uniqueness-constraints-for-structures-across-multiple-tables) : create table objects { uuid id; string type; } create table object_properties { uuid id; uuid source_id; // the object which has this property string name; // the property name uuid value_id; // the property value object } // ...and tables for each primitive data type create table string_properties { uuid id; uuid source_id; // the object which has this property string name; // the property name string value; // the property value string } where objects have properties (which can be linked to other objects)... What happens when we create a transaction which inserts records into all 3 tables? What happens in terms of reads and writes of other processes if the transaction is in the [SERIALIZABLE transaction level](https://www.cockroachlabs.com/docs/stable/demo-serializable.html) (CockroachDB and/or Postgres). > SERIALIZABLE isolation guarantees that even though transactions may execute in parallel, the result is the same as if they had executed one at a time, without any concurrency. I don't quite see the practical implications of that. Does it block reads until the table writes are COMMITed? What happens if there are multiple calls to such a transaction in parallel? What all happens during such an "all-table-spanning" sequence of writes transaction?
Asked by Lance Pollard (221 rep)
Aug 2, 2022, 08:14 AM
Last activity: Aug 2, 2022, 03:19 PM