1. Database transactions will reduce database performance. In order to ensure data consistency and isolation, transactions need to lock transactions. 2. If other transactions need to operate this part of data, they must wait for the last transaction to end (commit, rollback). Examplescreate table acct( acct_no varchar(32), acct_name varchar(32), balance decimal(16,2) ); insert into acct values ('0001','Jerry', 1000), ('0002','Tom', 2000); start transaction; -- Start transaction update acct set balance = balance - 100 where acct_no = '0001'; -- Simulate the deductor update acct set balance = balance + 100 where acct_no = '0002'; -- Simulate the payee commit; -- Transaction commit rollback; -- Transaction rollback Knowledge point expansion: Transactions
Big BusinessTransactions that take a long time to run and operate on a large amount of data
How to handle big transactions:
This concludes this article on the impact of MySQL transactions on efficiency. For more information on the impact of MySQL transactions on efficiency, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Vue3+Vite+TS implements secondary encapsulation of element-plus business components sfasga
>>: HTML table layout example explanation
Table of contents Project Background start Create...
1. Create a new rabbitmq in the /etc/init.d direc...
There was no problem connecting to the database y...
When developing a Vue project, you often need to ...
Preface I recently used a virtual machine to inst...
Since enabling https access for the entire site, ...
Table of contents 1. Advantages of proxy vs. Obje...
Summarize This article ends here. I hope it can b...
Recently, when I was drawing an interface, I enco...
From: https://blog.csdn.net/qq_44761243/article/d...
The EXPLAIN statement is introduced in MySQL quer...
This article example shares the specific code for...
For example, to query yesterday's newly regis...
Introducing Server-U software Server-U is a very ...
I finally finished the project at hand, and the m...