Sample Header Ad - 728x90

Advantage of "LOAD DATA ... REPLACE INTO TABLE" over "UPDATE table_name SET"

7 votes
2 answers
1928 views
I inherited a system in which all updates (even to a single row/record) to MySQL tables are not done using UPDATE table_name SET. Rather, they are done by: 1. Exporting the existing table to a CSV (text) file. 2. Modifying the corresponding row(s) in the CSV file. 3. Reloading the CSV file using LOAD DATA ... REPLACE INTO TABLE. This is the first time I see such an approach to updating table records and I am wondering what could be the rational for that. BTW, this scheme results in numerous thread synchronization issues because of the need to lock CSV files while updating. I would appreciate an explanation or insights on the benefits of using LOAD DATA ... REPLACE INTO TABLE instead of UPDATE table_name SET.
Asked by WebViewer (173 rep)
Oct 2, 2022, 08:44 AM
Last activity: Oct 2, 2022, 05:43 PM