MAX_STATEMENT_TIME uses confusing syntax
Description:
Via Chip Turner / WebscaleSQL mailing list at https://groups.google.com/forum/#!topic/webscalesql/r1Zwnhvi72I
----- It seems Oracle is taking the MAX_STATEMENT_TIME patch for 5.7, which is awesome, but I have a proposal for changing the syntax before it becomes baked into the upstream version. For context, currently you can't set a time limit on the time the server will spend executing a query. This patch allows it, via either a session variable (MAX_STATEMENT_TIME) or as part of a query. Specifically, you can do: SELECT MAX_STATEMENT_TIME = 90 * FROM foo; and it sets MAX_STATEMENT_TIME to 90, just for that query. When I first saw the syntax, I was confused by the '90 * FROM' -- it didn't feel right. The rest of the syntax just didn't feel natural to me overall, so after thinking more about it, and discussing with other mysql people here, a consensus emerged that we might want to change it before it's baked into upstream. I can see why it isn't a hint (it's reasonable to want a hard failure if a timeout can't be enforced, say, because the server isn't configured) These discussions brought two ideas: Add a RESOURCE LIMIT clause to SELECT, allowing something like: SELECT * FROM Foo WITH RESOURCE LIMIT MAX_STATEMENT_TIME = 90; or, more general, add "for this statement only" a session variable: SELECT * FROM Foo WITH SESSION MAX_STATEMENT_TIME =90; Currently, I believe "WITH" only is used for "WITH ROLLUP" and shouldn't cause any grammar problems. This gives us a more extensible syntax for future uses while being easier to understand when reading a query. I also think the name would be clearer as "MAX_STATEMENT_MILLISECONDS" -- we've found, very often, it's much simpler when configuration options (names in config files, command line parameters, etc) have the unit they expect as part of the name. It eliminates all ambiguity, especially since MySQL itself tends to prefer seconds for most units. Thoughts? ----- How to repeat:
N/A Suggested fix:
Thread provides a couple of suggestions for alternative syntax: * SELECT * FROM Foo WITH RESOURCE LIMIT MAX_STATEMENT_TIME = 90;
* SELECT * FROM Foo WITH SESSION MAX_STATEMENT_TIME =90;
* Changing from seconds to milliseconds for unit + renaming to MAX_STATEMENT_MILLISECONDS
Related: http://dev.mysql.com/worklog/task/?id=681
Thank you for the feature request.
Duplicate of Bug#77460 Remove old-style MAX_STATEMENT_TIME hint (replace with MAX_EXECUTION_TIME)
MAX_STATEMENT_TIME uses confusing syntax的更多相关文章
- APACHE SPARK 2.0 API IMPROVEMENTS: RDD, DATAFRAME, DATASET AND SQL
What’s New, What’s Changed and How to get Started. Are you ready for Apache Spark 2.0? If you are ju ...
- DevExpress VCL 13.1.2 发布
DevExpress VCL 的2013 第一个公开版发布, 基本上就是一些维护,没有大的变化,也没有FM 的支持. What's New in DevExpress VCL 13.1.2 Rel ...
- Nginx - Configuration File Syntax
Configuration Directives The Nginx configuration file can be described as a list of directives organ ...
- 14 Go's Declaration Syntax go语言声明语法
Go's Declaration Syntax go语言声明语法 7 July 2010 Introduction Newcomers to Go wonder why the declaration ...
- Go's Declaration Syntax
Introduction Newcomers to Go wonder why the declaration syntax is different from the tradition estab ...
- Part 33 Angular nested scopes and controller as syntax
Working with nested scopes using $scope object : The following code creates 3 controllers - country ...
- 如何在Open Live Writer(OLW)中使用precode代码高亮Syntax Highlighter
早先Microsotf的Windows Live Writer(WLW)现在已经开源了,并且更名为Open Live Writer,但是现在Windows Live Writer还是可以现在,Open ...
- Linix登录报"/etc/profile: line 11: syntax error near unexpected token `$'{\r''"
同事反馈他在一测试服务器(CentOS Linux release 7.2.1511)上修改了/etc/profile文件后,使用source命令不能生效,让我帮忙看看,结果使用SecureCRT一登 ...
- 获取文件的缩略图Thumbnail和通过 AQS - Advanced Query Syntax 搜索本地文件
演示如何获取文件的缩略图 FileSystem/ThumbnailAccess.xaml <Page x:Class="XamlDemo.FileSystem.ThumbnailAcc ...
随机推荐
- ASP.NET MVC View使用Conditional compilation symbols
由于View(.cshtml)的运行时编译关系,在项目级别中定义的symbols是无法被直接使用的.需要在Web.config中添加compilerOptions(在View目录下的Web.confi ...
- Android 源码下载,国内 镜像
AOSP(Android) 镜像使用帮助 https://lug.ustc.edu.cn/wiki/mirrors/help/aosp 首先下载 repo 工具. mkdir ~/bin PATH=~ ...
- linux下jmeter持续集成Jenkins部署时问题解决
之前成linux下安装了Jenkins,并做了一些简单的工作,这次正好将jmeter也集成进去,在实际操作时发现好多坑,写下做记录 怎么安装这里就不介绍了,网上很多资料,这里只记录问题,以供大家参数 ...
- express运行原理
一.express底层:http模块 Express框架建立在node.js内置的http模块上.http模块生成服务器的原始代码如下. var http = require("http&q ...
- python3查询数据库并生成excel报表
#!/usr/bin/env python3 #encoding=UTF- import os import time import xlwt hostIp = 'xxx.xxx.xxx.xx' us ...
- 使用Wireshark分析QQ聊天
- php---截取描述方法
参考: https://www.cnblogs.com/xsphehe/p/5682004.html 示例: /** * 参数说明 * $string 欲截取的字符串 * $sublen 截取的长度 ...
- jsp页面获取参数的方法(url解析、el表达式赋值、session取值)【原创】
最近使用myEclispse做网站,使用jsp+js+css做页面,网站中常用到从列表进入详情页面的跳转,下面对详情页面的值填充方式做一个简单总结: 1.url中使用request获取参数 jsp上方 ...
- BC32206 错误
出现这种情况的话 排除代码引入dll版本的原因 看下是不是 你之前用net reflector 生成了pdb文件 导致项目引入的版本都是他生成的文件 处理方案就是 用everything 找到这个dl ...
- Nginx防止恶意域名解析
为了防止别人恶意将大量域名解析到自己的网站上面.我们可以对nginx做防止恶意域名解析,这样就只能通过自己的域名访问网站,其他域名就会显示错误500 打开Nginx配置文件nginx.conf,在原来 ...