[5 May 2014 18:46] Morgan Tocker
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
[6 May 2014 3:53] Laurynas Biveinis
Related: http://dev.mysql.com/worklog/task/?id=681
[6 May 2014 4:36] Erlend Dahl
Thank you for the feature request.
[27 Aug 2015 4:15] Erlend Dahl
Duplicate of 

Bug#77460 Remove old-style MAX_STATEMENT_TIME hint (replace with MAX_EXECUTION_TIME)

MAX_STATEMENT_TIME uses confusing syntax的更多相关文章

  1. 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 ...

  2. DevExpress VCL 13.1.2 发布

    DevExpress VCL 的2013 第一个公开版发布, 基本上就是一些维护,没有大的变化,也没有FM 的支持. What's New in DevExpress VCL 13.1.2   Rel ...

  3. Nginx - Configuration File Syntax

    Configuration Directives The Nginx configuration file can be described as a list of directives organ ...

  4. 14 Go's Declaration Syntax go语言声明语法

    Go's Declaration Syntax go语言声明语法 7 July 2010 Introduction Newcomers to Go wonder why the declaration ...

  5. Go's Declaration Syntax

    Introduction Newcomers to Go wonder why the declaration syntax is different from the tradition estab ...

  6. Part 33 Angular nested scopes and controller as syntax

    Working with nested scopes using $scope object : The following code creates 3 controllers  - country ...

  7. 如何在Open Live Writer(OLW)中使用precode代码高亮Syntax Highlighter

    早先Microsotf的Windows Live Writer(WLW)现在已经开源了,并且更名为Open Live Writer,但是现在Windows Live Writer还是可以现在,Open ...

  8. Linix登录报"/etc/profile: line 11: syntax error near unexpected token `$'{\r''"

    同事反馈他在一测试服务器(CentOS Linux release 7.2.1511)上修改了/etc/profile文件后,使用source命令不能生效,让我帮忙看看,结果使用SecureCRT一登 ...

  9. 获取文件的缩略图Thumbnail和通过 AQS - Advanced Query Syntax 搜索本地文件

    演示如何获取文件的缩略图 FileSystem/ThumbnailAccess.xaml <Page x:Class="XamlDemo.FileSystem.ThumbnailAcc ...

随机推荐

  1. 一个js文件如何加载另外一个js文件

    方法一,在调用文件的顶部加入下例代码: document.write(”<script language=javascript src=’/js/import.js’></scrip ...

  2. maven常用的plugin

    maven-compiler-plugin 编译Java源码,一般只需设置编译的jdk版本   <plugin> <groupId>org.apache.maven.plugi ...

  3. Windows Server 2008 R2之二从介质安装 AD DS

    可以使用 Ntdsutil.exe 为在域中创建的其他域控制器创建安装介质.通过从介质安装,可以最大程度地减少网络上目录数据的复制.有利于在远程站点中更高效地安装其他域控制器. 实验环境: 在Wind ...

  4. Spring JPA配置讲解

    JPA是Java EE5规范之一,是一个orm规范,由厂商来实现该规范.目前有hibernate,OpenJPA,TopLink和EclipseJPA等实现 Spring提供三种方法集成JPA: 1. ...

  5. vue之单表输入绑定

    vue的核心:声明式的指令和数据的双向绑定. 那么声明式的指令,已经给大家介绍完了.接下来我们来研究一下什么是数据的双向绑定? 另外,大家一定要知道vue的设计模式:MVVM M是Model的简写,V ...

  6. Nginx通过header转发

    假设添加自定义头 "my-header",当"my-header"等于test时,转发到192.168.1.113 请求如下 wget --header=&qu ...

  7. 被included或者被required的文件都来自哪里呢

    过PHP,你可以使用不同函数帮助你重用代码.具体用到的函数取决于你打算重用的内容. 主函数如下: * include() and include_once() * require() and requ ...

  8. Nginx限制IP访问及获取客户端realip实战

    做网站时经常会用到remote_addr和x_forwarded_for这两个头信息来获取客户端的IP,然而当有反向代理或者CDN的情况下,这两个值就不够准确了,需要调整一些配置.Nginx作为web ...

  9. VUE中父组件向子组件传递数据 props使用

    VUE中,子组件是不能直接访问父组件的数据(一般来说,当然如果你要破坏原则也是可以),如下< <body> <div id="fathercomponent" ...

  10. Centos6.10安装tomcat

    1.  下载tomcat 2.  解压到相应的路径下 tar -xzvf apache-tomcat-8.5.34.tar.gz 3.  启动tomcat # 进入"apache-tomca ...