Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
computer_science:databases:mysql:mysql_tips_trics [2021/03/07 17:07] – [Log Queries in Development] carlossousa | computer_science:databases:mysql:mysql_tips_trics [2023/12/01 12:07] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 45: | Line 45: | ||
< | < | ||
tail -f / | tail -f / | ||
+ | |||
+ | </ | ||
+ | ===== Use Transactions for bulk insert: ===== | ||
+ | |||
+ | **Pros:** Only one re-index, at the end of the transaction. | ||
+ | |||
+ | **Cons: **Visibility of new data only after commit - this can be considered an upside -. | ||
+ | |||
+ | **Usage:** | ||
+ | < | ||
+ | START transaction; | ||
+ | insert into table values (default, 1); | ||
+ | insert into table values (default, 2); | ||
+ | insert into table values (default, 3); | ||
+ | insert into table values (default, 4); | ||
+ | insert into table values (default, 5); | ||
+ | COMMIT; | ||
</ | </ | ||