You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And the LOCK seems also to lock the constraint tables (titlewords, contentwords, tagwords, posttags):
If you lock a table explicitly with LOCK TABLES, any tables related by a foreign key constraint are opened and locked implicitly. For foreign key checks, a shared read-only lock (LOCK TABLES READ) is taken on related tables. For cascading updates, a shared-nothing write lock (LOCK TABLES WRITE) is taken on related tables that are involved in the operation.
INSERT INTO loggingtable (url) SELECT url FROM tablewithurls u LEFT JOIN loggingtable l ON l.url=t.url WHERE {some criterion used to pick the url to work on} AND l.url IS NULL
The text was updated successfully, but these errors were encountered:
q2apro
changed the title
Prevent "LOCK TABLES" found in qa_db_word_mapto_ids_add($words)?
Prevent "LOCK TABLES" found in qa_db_word_mapto_ids_add($words)
May 11, 2020
q2apro
changed the title
Prevent "LOCK TABLES" found in qa_db_word_mapto_ids_add($words)
Prevent "LOCK TABLES" in qa_db_word_mapto_ids_add($words)
May 11, 2020
I am still wondering why some of my heavy visited website requests take a while, one of the culprits is the indexing, which I need to accept as necessary. But now I stumbled over https://github.com/q2a/question2answer/blob/dev/qa-include/db/post-create.php#L249
From my understanding, the entire db table gets locked until it is unlocked again. So no other queries can take place.
Shouldn't a LOCK be avoided regarding performance issues and other problems?
See also https://stackoverflow.com/q/6621303/1066234
And the LOCK seems also to lock the constraint tables (titlewords, contentwords, tagwords, posttags):
https://dev.mysql.com/doc/refman/8.0/en/lock-tables.html
Probably the insert of missing words can be put into one single MYSQL query, see examples at:
https://stackoverflow.com/a/6621549/1066234
https://stackoverflow.com/a/6621547/1066234
Probably helpful too: "MySQL: Insert record if not exists in table" https://stackoverflow.com/q/3164505/1066234
The text was updated successfully, but these errors were encountered: