Questions tagged [concurrency]
For questions about issues arising when multiple users or processes concurrently access or modify shared information in a database system.
334 questions
0 votes
1 answer
55 views
Can this MySQL UPDATE cause a deadlock?
Let's say I have a table with a primary key id and I added a nullable int called worker_id. I have a large amount of records so I run workers in parallel. First I run SELECT id FROM foo WHERE ...
0 votes
1 answer
44 views
Saw some strange behavior when using `INSERT ON CONFLICT` inside a transaction
Repro steps: Create the table: create table t (col TEXT primary key); Open two database consoles and use the following queries in them: 1 begin; 2 select txid_current(); 3 insert into t (col) ...
0 votes
1 answer
96 views
mysql/postgresql row lock in high concurrency scenarios
i have a simple transaction with isolation level READ COMMITTED The table setting is simple create table example.parent_tbl( id int auto_increment primary key ); create table example.child_tbl( id ...
1 vote
1 answer
260 views
How to know, when it is time to vacuum an sqlite database file?
Sqlite, contrary most SQL-compatible DB engine, is working directly on files instead over network sockets. It is also not very good in concurrency, beside that deletion operators are mostly advisory (...
2 votes
0 answers
77 views
How to prevent anomalies in a tree data structure
I have two tables node and node_tree: CREATE TABLE node ( id integer PRIMARY KEY ); CREATE TABLE node_tree ( node_id integer references node(id) UNIQUE, parent_id integer references node(id) ); ...
3 votes
1 answer
208 views
Make sure that only one transaction updates a row
I have users table CREATE TABLE tasks( id UUID PRIMARY KEY, status TEXT REFERENCES statuses, -- available statuses are 'NEW', 'PENDING', 'PROCESSING', 'COMPLETE' created_at TIMESTAMP WITH ...
1 vote
1 answer
61 views
How does Oracle 12c handle the execution order of identical DML statements across distinct transactions?
I'm administering an Oracle 12c database and need to understand how the database handles the execution order of DML (Data Manipulation Language) statements when executed across different transactions ...
7 votes
4 answers
1k views
Is my queue table implementation race condition safe?
Hello people smarter than me! I've created a sort-of-a-queue table system, but it seems too simple to be safe from race conditions. Am I missing something or is the following race condition safe? The ...