[Kamailio-Users] [offtopic] update vs delete/insert
Daniel-Constantin Mierla
miconda at gmail.com
Mon Oct 6 17:01:51 CEST 2008
Hello,
On 10/06/08 12:12, Henning Westerholt wrote:
> On Monday 06 October 2008, toly wrote:
>
>> I can answer about Sybase: update is delete/insert, and optimizer will do
>> it more effectively the executing 2 different transaction.
>>
>
> Hi Daniel,
>
> i think that doing a update is faster then doing two queries. The core need to
> construct another SQL string, the DB need to be parse this and so on.. It
> probably depend on the DB type, and exact configuration, but i doubt the
> difference will be that relevant. Doing a delete and insert in two steps is
> also different from the update that you have one small interval of
> inconsisteny where the old record has been deleted, and the new one not yet
> created (if you don't use transactions).
>
> Aparently also for postgres an UPDATE is also the same as and DELETE/INSERT.
> [1], which means its faster here too.
>
ok. I was looking to use prepare statements or a stored procedure.
However, seems some db servers are doing it in this way, so probably
there are internal optimizations.
Thanks,
Daniel
> Cheers,
>
> Henning
>
>
> [1] http://archives.postgresql.org/pgsql-performance/2005-12/msg00589.php
>
> _______________________________________________
> Users mailing list
> Users at lists.kamailio.org
> http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
>
>
--
Daniel-Constantin Mierla
http://www.asipto.com
More information about the Users
mailing list