Locking Mechanism? LOAD DATA INFILE

Hey folks,

Pls help me to understand, is there any locking happens when we use LOAD DATA LOCAL INFILE F1 INTO TABLE T1.

If there is any locking? then what kind of locking it is table level or row level.
And what happens if we perform such operation in business hours, will it have any impact on APIs i.e. as APIs have select queries from the same table in which Loading is performed.
So APIs will respond normally or because of table locking (if there) ?

Will be great help guys, if you can respond on this asap.

Hi hiteshupreti5! :wave: Thanks for utilizing the forum to ask this question. I’ll be working on getting a team member to help clarify this. In the meantime, can you let me know if you are running the managed or self-hosted service and what version you are using?

LOAD DATA will lock any rows it writes until the transaction running the LOAD DATA commits. So, existing rows in the table should only be locked if using the REPLACE syntax to over write existing rows (otherwise the LOAD will be inserting new rows that won’t be visible to other transaction until commit anyways).