Tema: Lockovanje
Pogledajte određenu poruku
Staro 22. 05. 2009.   #2
degojs
I'm a PC too.
Wrote a book
 
Avatar degojs
 
Datum učlanjenja: 06.06.2005
Lokacija: Kanada
Poruke: 1.354
Hvala: 82
130 "Hvala" u 89 poruka
degojs će postati "faca" uskorodegojs će postati "faca" uskoro
Default

Aa.... otkud znaš da je lock trećeg izazvao prvi, a ne drugi upit (UPDATE)?

Vidi i ovo:

SHOW PROCESSLIST; also helps a lot.
...

MyISAM doesn’t support transactions, and prioritises updates over reads. To avoid inconsistent data, reads can cause implicit table locks.

Where this matters is a situation like the following:

SELECT * from bigTable WHERE (complicatedQueryConditions);

UPDATE bigTable SET someField=someField+1 WHERE id=1;

The SELECT will lock out the UPDATE until it finishes, and because updates are prioritised over reads and new selects will in turn be waiting for the UPDATE to finish.
__________________
Commercial-Free !!!
degojs je offline   Odgovorite uz citat