UPDATE LOW_PRIORITY和INSERT DELAYED INTO有什么优点? [英] What are the advantages of UPDATE LOW_PRIORITY and INSERT DELAYED INTO?

查看:134
本文介绍了UPDATE LOW_PRIORITY和INSERT DELAYED INTO有什么优点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在查看一些代码,并注意到UPDATE LOW_PRIORITYINSERT DELAYED INTO用于更新数据库.这些语句的用途是什么?我是否应该在同一数据库中各个表的每个插入和更新语句中使用它们?

I was going through some code and noticed that UPDATE LOW_PRIORITY and INSERT DELAYED INTO are used for updating the database. What is is the use of these statements? Should I use these in every insert and update statement for various tables in the same database?

推荐答案

使用

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.

INSERT语句的 DELAYED 选项是如果您的客户端无法或不需要等待INSERT完成,则对标准SQL的MySQL扩展非常有用.当您使用MySQL进行日志记录并且定期运行需要很长时间才能完成的SELECT和UPDATE语句时,这是一种常见情况.

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.

这篇关于UPDATE LOW_PRIORITY和INSERT DELAYED INTO有什么优点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆