Re: UPSERT with non-unique index

The Natural Philosopher <[email protected]> Mon, 3 Aug 2020 19:09:45 +0100
Newsgroups comp.databases.mysql
Organization A little, after lunch
Message-ID <[email protected]>
On 03/08/2020 18:45, Stanimir Stamenkov wrote:
> Sun, 2 Aug 2020 20:15:03 +0200, /J.O. Aho/:
> 
>> I would suggest you use
>>
>> LOCK TABLES table WRITE;
>>
>> <do what you did before>
>>
>> UNLOCK TABLES;
>>
>>
>> LOCK TABLES table WRITE;
>>
>> UNLOCK TABLES;
>>
>> https://www.mysqltutorial.org/mysql-table-locking/
>> https://dev.mysql.com/doc/refman/5.7/en/lock-tables.html
> 
> Wouldn't this basically block concurrent inserts/updates?  I don't want 
> to block all on the same table trying to insert/update different sets of 
> data.
> 
it wont be for long...


-- 
“People believe certain stories because everyone important tells them, 
and people tell those stories because everyone important believes them. 
Indeed, when a conventional wisdom is at its fullest strength, one’s 
agreement with that conventional wisdom becomes almost a litmus test of 
one’s suitability to be taken seriously.”

Paul Krugman