Subject | Re: Is Update or Insert more slower than an single Update (or insert) |
---|---|
Author | Dmitry Yemanov |
Post date | 2012-01-14T18:32:17Z |
14.01.2012 16:40, Vander Clock Stephane wrote:
surely slower than INSERT, see below.
were affected) attempts to insert the row, so being slower than a
singleton INSERT shouldn't be a surprise.
Dmitry
> Thanks to my paranoia, i was thinking like everyone thatUPDATE OR INSERT should be nearly the same in speed as UPDATE but it's
>
> Update or insert
> OR
> Insert
>
> will be close to the same speed (or very similar)
surely slower than INSERT, see below.
> so i do the test .... and guess ?It tries to update the table using the condition and then (if no rows
>
> Update or insert is 2x more slower than insert alone :( :( :(
>
> 100000 Update or insert => 0.501 ms average insert time
> 100000 insert => 0.300 ms average insert time
>
> sad but interesting to know !
were affected) attempts to insert the row, so being slower than a
singleton INSERT shouldn't be a surprise.
Dmitry