当前位置:网站首页>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_timeconfiguration, 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 exceededReferences:
边栏推荐
猜你喜欢

mysql is not an internal or external command, nor is it a runnable program or batch file to resolve

oracle row to column, column to row summary

Flink CDC implements Postgres to MySQL streaming processing transmission case

Oracle数据库SQL优化详解

Jdbc & Mysql timeout分析

vulnhub-XXE ctf security question

Online sql editing query tool sql-editor

线程的5种状态
awd --waf deployment

3 minutes to tell you how to become a hacker | Zero foundation to hacker introductory guide, you only need to master these five skills
随机推荐
【数仓】数据仓库高频面试题题英文版(1)
Jdbc & Mysql timeout分析
第一个WebAssembly程序
根据ip地址获取地理位置及坐标(离线方式)
[PASECA2019]honey_shop
Redis 客户端常见异常分析
CTF misc-audio and video steganography
TDengineGUI无法连接TDengine
Mysql 客户端常见异常分析
SQL Server 数据库之生成与执行 SQL 脚本
sql concat() function
Flink-流/批/OLAP一体得到Flink引擎
Understand JDBC in one article
【数仓】数据质量
sql concat()函数
【Spark】Spark 高频面试题英语版(1)
SQL Server安装教程
Using custom annotations, statistical method execution time
Arrays工具类的使用
A Spark task tuning 】 【 one day suddenly slow down how to solve