views:

29

answers:

3

I was going through some code and noticed that UPDATE LOW_PRIORITY and DELAYED INTO used for inserting and updating database. what is is the use of this code?? why we need to use this??

any Ideas??

Do I need to use it in every insertion and updation for various tables in same database??

+1  A: 

With the LOW_PRIORITY keyword, execution of the UPDATE is delayed until no other clients are reading from the table. Normally, reading clients are put on hold until the update query is done. If you want to give the reading clients priority over the update query, you should use LOW_PRIORITY.

The DELAYED option for the INSERT statement is a MySQL extension to standard SQL that is very useful if you have clients that cannot or need not wait for the INSERT to complete. This is a common situation when you use MySQL for logging and you also periodically run SELECT and UPDATE statements that take a long time to complete.

Sjoerd
+1  A: 

If your UPDATEs on MySQL a read intensive environment are taking as much as 1800 seconds then it is advisable to use the UPDATE LOW_PRIORITY.

Dharma
A: 

This need to use then you have big load on server. And you now that some UPDATE or INSERT is now hight priority and the can act on load.

Exp. SQL that generate some statistic or items top. The are slowly and not need executed immediately.

Liutas