Putting Concurrency to the Test
Perform a few tests to learn more about how concurrency works in SQL.
We'll cover the following...
When we benchmark the concurrency properties of the two statements, we quickly realize that the activity table is badly designed. The unique constraint includes a timestamptz field, which in PostgreSQL is only precise down to the microsecond.
Fixing
...Ask