[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. 学习生活必须知道的网站或者App

    转载自:https://www.douban.com/group/topic/89798480/ 学习方面: 1.网易公开课(http://v.163.com/special/test/alltest ...

  2. Android.mk 用法介绍

    一个Android.mk file用来向编译系统描述你的源代码.具体来说:该文件是GNU Makefile的一小部分,会被编译系统解析一次或多次.你可以在每一个Android.mk file中定义一个 ...

  3. 使用 intellijIDEA + gradle构建的项目如何debug

    在intellij IDEA里建立gradle项目(使用jett插件的web项目) 使用intellijIDEA提供的debug无效(无法进入断点) 摸索了一下,通过远程调试的方法来进行调试是可行的 ...

  4. Mac OS 安装phpMyAdmin

    http://www.coolestguyplanettech.com/installing-phpmyadmin-on-mac-osx-10-7-lion/

  5. Spring Cloud Eureka 高可用注册中心

    参考:<<spring cloud 微服务实战>> 在微服务架构这样的分布式环境中,各个组件需要进行高可用部署. Eureka Server 高可用实际上就是将自己作为服务向其 ...

  6. python----并发编程之IO模型

    一:IO模型介绍  同步(synchronous) IO和异步(asynchronous) IO,阻塞(blocking) IO和非阻塞(non-blocking)IO分别是什么,到底有什么区别?这个 ...

  7. VS2015 中使用 MVC4

    最近把机子升级到win10 觉得还是好用, 又看了一个vs最新版,于时就安了个vs2015 可以前MVC4的项目用不起了 System.Web.Mvc这个有叹号,生成还要报错, 看了一下原因找不到4. ...

  8. POJ--3321 Apple Tree(树状数组+dfs(序列))

    Apple Tree Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 22613 Accepted: 6875 Descripti ...

  9. JavaScript学习11.30

    window.history:包含浏览器的历史,可以不时用window这个前缀history.back():加载历史列表的前一个URLhistory.forward():加载历史列表的后一个URLwi ...

  10. TensorFlow 度量张量和张量或者和零之间的误差值

    用于一个回归任务或者正则问题 # l2损失,output= sum(x ** 2)/2 inputdata = tf.Variable(np.random.rand(2,3), dtype=np.fl ...