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
1. Install Apache # yum install -y httpd httpd-de...
Why do we say “usually 1em=16px”? The default tex...
Table of contents Immediately execute function fo...
{ {}} Get the value, the original content of the ...
Table of contents Preface environment Install Cre...
Effect Need environment vue elementUI Drag and dr...
Table of contents What is an index? Leftmost pref...
Preface This article lists several common, practi...
The meaning of key_len In MySQL, you can use expl...
Using the official MySQL image requires some modi...
Currently, most CPUs support floating-point units...
This article mainly introduces several scheduling...
nginx is our most commonly used server, often use...
motivation Due to learning needs, I purchased a v...
If you use docker search centos in Docker Use doc...