Is mysql UPDATE faster than INSERT INTO?

It is rather a matter of theory.

If I run 50,000 requests that insert new lines and 50,000 requests that update these lines, what will take less time?

+5
source share
4 answers

The insert will be faster, because when updating, you need to first search for the record you are about to update, and then perform the update.

Although this is hardly likely to be a correct comparison, since you will never have a choice whether to insert or update, since the two fill two completely different needs.

EDIT: , , , .

+4
Insert Operation : Create  -> Store

Update Operation : Retrieve -> Modify -> Store

.

+4

​​ , , . , , ( ) - , , . , , .

+1

, , , , , , .

, - , . , - ( ) , InnoDB ( PHPMyAdmin ).

- , , .

0

All Articles