Updating multiple rows chauffeur personals dating

Rated 3.90/5 based on 594 customer reviews

If you are using Alibaba Cloud RDS, you may try the writing to combine the update and select statements into an SQL statement, and further reduce the network overhead and database overhead to improve the performance.

select count from update likes set gmt_modified = now(), count = count 1 where object_id = ?; It is important to note that the enhanced syntax is not expressly stated in the cloud database document.

Discovering this problem, the back-end engineer considers what to do if the product manager who focuses on user experience thinks that the time window for the user to feel the enthusiasm is too long so as to result in a poor user experience, and wants to remove the time window from update to select.

If there are other requests sent in this time window, the data will surely be contaminated, so we should block the other requests, and never execute the update statement before finishing the select statement. Adding a transaction may be the solution, and the transaction isolation level must be Read committed or higher.

The transaction will implement line blocking of that row using the update statement at the beginning, so that the other requests can only update the same row after the transaction completion report is returned. However, it may be refused by the architect during code review if we open a transaction so casually just for such a small requirement.

The time used for network communication between the server and database for queries completely subject to indexes is many times that for queries in the database, plus begin and commit, which is meant to double the query time.

This rule allows you to update values on multiple rows in a single UPDATE statement.

-------------- ------------ ------ ----- --------- ---------------- | Field | Type | Null | Key | Default | Extra | -------------- ------------ ------ ----- --------- ---------------- | id | bigint(20) | NO | PRI | NULL | auto_increment | | gmt_created | datetime | NO | | NULL | | | gmt_modified | datetime | NO | | NULL | | | object_id | bigint(20) | NO | | NULL | | | count | bigint(20) | NO | | 0 | | -------------- ------------ ------ ----- --------- ---------------- Then we click Like on the page.Even until now, there is still no way to have it done via a single query in the Oracle-maintained official version of My SQL. Besides the Maria DB which has been thoroughly split out, there is also Percona, the so-called enhanced version which is fully compatible with My SQL.Besides Percona which provides source code, there is also Ali SQL maintained by Alibaba, and the database-as-a-service Alibaba Cloud RDS.We noted that the two SQL statements are not in the same transaction; therefore, the count obtained via the select statement is not necessarily the result of the previous update statement.Instead, it may be subject to another update statement, so that the user can feel the enthusiasm of other users during the period when the database begins to execute the update statement, and during the period when the update statement is executed until the select statement starts to be executed.

Leave a Reply