当前位置:网站首页>MySQL special statement and optimizer
MySQL special statement and optimizer
2022-07-30 06:55:00 【If I don't see you tomorrow】
SQL_NO_CACHE
/*!40001 SQL_NO_CACHE */
means executing SELECT SQL_NO_CACHE * FROM mytable
in mysql >= 4.0.1 and not executing the command in earlier versionswith SQL_NO_CACHE
.
SELECT /*!40001 SQL_NO_CACHE */ * FROM `test`.`house`;
The query cache was deprecated in MySQL 5.7.20 and removed in MySQL 8.0.
SLEEP
Sleep (pause) duration for the number of seconds given by the parameter, then return 0.Duration may have fractional parts.If the argument is NULL or negative, SLEEP() produces a warning or an error in strict SQL mode.
select *,sleep(n) from table
,
If the table record is empty, it will not sleep; if the table record is one, the sleep time is 1n, ifThe table record is x, and the sleep time is: xn.
MAX_EXECUTION_TIME
sql sets the MAX_EXECUTION_TIME
parameter to control the execution time of the statement. If the execution is not completed within this time range, the operation will be terminated
show variables like 'max_execution_time';
You can viewmax_execution_time
configuration, MySQL 5.7.8+ version supports this parameter
SELECT /*+ MAX_EXECUTION_TIME(1000) */1 FROM t1 WHERE SLEEP(1000);> ERROR 3024 (HY000): Query execution was interrupted, maximum statement> execution time exceeded
References:
边栏推荐
- GraphQL(一)基础介绍及应用示例
- JVM学习(二) 垃圾收集器
- uni-app: about custom components, easycom specs, uni_modules, etc.
- 【Spark】Spark 高频面试题英语版(1)
- C# WPF中监听窗口大小变化事件
- Dcat Admin installation
- Blind injection, error injection, wide byte injection, stack injection study notes
- 十七、Kotlin进阶学习:1、守护线程;2、线程和协程之间的效率对比;3、取消协程;
- sqli-labs shooting range SQL injection learning Less-1
- SQL Server安装教程
猜你喜欢
Arrays工具类的使用
Jackson serialization failure problem - oracle data return type can't find the corresponding Serializer
protobuf编码及网络通信应用(一)
sqli-labs shooting range SQL injection learning Less-1
mysql删除表中重复数据,(只保留一行)
Awd summary
[HCTF 2018]admin
Thread state of five
JDBC programming of MySQL database
Remember a Mailpress plugin RCE vulnerability recurrence
随机推荐
[PASECA2019]honey_shop
MySQL - 函数及约束命令
FastAPI Quick Start
Student management system
Invalid bound statement (not found)出现的原因和解决方法
oracle行转列、列转行总结
SQL Server安装教程
二十二、Kotlin进阶学习:简单学习RecyclerView实现列表展示;
Detailed MySQL-Explain
mysql不是内部或外部命令,也不是可运行的程序或批处理文件解决
网上说的挖矿究竟是什么? 挖矿系统开发详解介绍
uni-app: about custom components, easycom specs, uni_modules, etc.
Jackson 序列化失败问题-oracle数据返回类型找不到对应的Serializer
在不同的服务器上基于docker部署redis主从同步
正则表达式语法详解及实用实例
MySQL - Function and Constraint Commands
php vulnerability full solution
Trust anchor for certification path not found.异常解决方法。
MySQL 特殊语句及优化器
Function 函数式接口及应用