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 ...
随机推荐
- web开发之Cookie使用
做过web开发的小伙伴对于Cookie一定不陌生,当用户登录后将用户的账号保存到本地,密码保存时,建议使用MD5进行加密,以防止用户个人信息的泄露.今天和大家简单聊聊关于Jquer Cookie的使用 ...
- 栈和队列的基础算法学习(EPI)
今天学习的时间虽然挺多的,但是总觉效率不高.其实今天没有按照计划进行EPI题目的浏览,白天去看了其他的书籍.准备找工作可能需要的状态是一定量经典的书,偶尔温习才可.书是看不完的,知识点也是固定的.所以 ...
- gem install 和 bundle 区别
bundle install 在设置了所有包含在Gemfile中的东西.你也可以传递参数. 如果在production模式下,你很清晰的区分了每个app需要的gems. gem install 则安装 ...
- 用ELK打造可视化集中式日志
原文链接:https://yq.aliyun.com/articles/57420 摘要: Elk是Elastic search, Logstash和Kibana三者的简称. Elastic sear ...
- STS没有找到Dynamic Web Project
解决:安装JavaEE插件 help-> install new software-> 选择sts对应的eclipse版本站点,如eclipse版本4.09选择2018-09.4.10选择 ...
- Python之Subprocess模块
PS:打开文件时候加b参数是代表以二进制方式打开,在Linux加不加都可以,在windows上面最好加b参数否则可能会出现问题 使用system返回执行结果不赋值,使用popen返回了结果赋值给cmd ...
- Linux下搭建hadoop开发环境-超详细
先决条件:开发机器需要联网 已安装java 已安装Desktop组 1.上传安装软件到linux上: 2.安装maven,用于管理项目依赖包:以hadoop用户安装apache-maven-3.0.5 ...
- redis 事务 even when a command fails, all the other commands in the queue are processed
even when a command fails, all the other commands in the queue are processed 单个 Redis 命令的执行是原子性的,但 R ...
- php.exe
PhpStorm 10.0.2 php interpreter 填入php.exe 暂且不用填写 Listen 63342
- iOS-数据缓存(转载)
一.关于同一个URL的多次请求 有时候,对同一个URL请求多次,返回的数据可能都是一样的,比如服务器上的某张图片,无论下载多少次,返回的数据都是一样的. 上面的情况会造成以下问题 (1)用户流量的浪费 ...