What could be wrong in the next transaction if executed by concurrent users at the default isolation level READ COMMITTED?
BEGIN TRANSACTION SELECT * FROM t WHERE pid = 10 and r between 40 and 60 -- ... this returns tid = 1, 3, 5 -- ... process returned data ... DELETE FROM t WHERE tid in (1, 3, 5) INSERT INTO t (tid, pid, r) VALUES (77, 10, 35) INSERT INTO t (tid, pid, r) VALUES (78, 10, 37) INSERT INTO t (tid, pid, r) VALUES (79, 10, 39) COMMIT
You may have serious performance issues from dead castles
SELECT will receive a shared lock on the page, and then DELETE will try to update these locks to exclusive locks.
, . , , . , . , , . , , , . , , , .
- , , get-go. concurrency , .
, ? , , . .
, oracle postgres. , . .
SELECT, , tid 1, 3 5. , . , . , . , ( , ) . , ?
, , SELECT ... FROM ... FOR UPDATE; , . http://www.postgresql.org/docs/8.4/interactive/sql-select.html
SELECT ... FROM ... FOR UPDATE;
Source: https://habr.com/ru/post/1739908/More articles:Minimize any program in the system tray - c #Can someone recommend a good tutorial on MySQL indexes, in particular when it is used in an order by clause during a connection? - joinC # regex to check for “realistic” IP values - c #https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1739906/how-to-export-eclipselink-objects-to-xml&usg=ALkJrhjD3JqBCscunR5OLUAUK0IS4egInwJAXB Аннотированная установка класса переменной, которая не является элементом - javaPython list like * args? - pythonRx: объединение нескольких IObservable веб-запросов - c#C # Thread-safe Extension Method - multithreadingClient-side validation with modelless view in ASP.NET MVC 2 - asp.net-mvc-2Why are most marketing tags (Omniture, XE, etc.) written with document.write ()? - javascriptAll Articles