fix(mysql): handle table initialization better in clustered database environments
The CREATE TABLE IF NOT EXISTS yields more locks than checking if the table exists using a SELECT first before running CREATE TABLE. This makes more sense as the table usually already exists, so we optimize for the happy path.
This commit is contained in:
parent
e396266f3d
commit
aef2d7c861
2 changed files with 23 additions and 1 deletions
5
.changeset/thirty-beds-fetch.md
Normal file
5
.changeset/thirty-beds-fetch.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@emigrate/mysql': patch
|
||||
---
|
||||
|
||||
Avoid "CREATE TABLE IF NOT EXISTS" as it's too locking in a clustered database when running it concurrently
|
||||
Loading…
Add table
Add a link
Reference in a new issue