[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. 计算机从加电到系统(Linux)启动完成

    0x0 背景 在我参加的面试和我面试别人.或者参加别人对别人的面试的事后经常遇到的一个问题就是:请从计算机加电开始描述一下计算机启动到操作系统正式启动起来的全过程.这是一个考验对计算机体系结构和基本知 ...

  2. 【CF633H】Fibonacci-ish II 莫队+线段树

    [CF633H]Fibonacci-ish II 题意:给你一个长度为n的序列$a_i$.m个询问,每个询问形如l,r:将[l,r]中的所有$a_i$排序并去重,设得到的新数列为$b_i$,求$b_1 ...

  3. Root Motion的脚本处理

    一.Apply RootMotion的作用 Apply RootMotion:控制角色在场景中动画的运动.角色动画驱动角色运动,类似于在游戏中直接使用动画,提高了动画的使用效率. Root Motio ...

  4. Unity3D笔记 英保通二

    一.访问另一个物体 1.代码中定义一个public的物体 例如:var target:Transform; 在面板上直接拖拽一个物体赋值给target 2.通过GameObject.Find(&quo ...

  5. FileStream实现多线程断点续传(已封装)

    处理文件分片 处理缺失的分片文件 合并分片文件 MD5验证文件 using System; using System.Collections.Generic; using System.IO; usi ...

  6. 小程序中的block

    <block/> 并不是一个组件,它仅仅是一个包装元素,不会在页面中做任何渲染,只接受控制属性. 因为 wx:if 是一个控制属性,需要将它添加到一个标签上.如果要一次性判断多个组件标签, ...

  7. Spring注解及作用

    一: spring mvc中的@PathVariable是用来获得请求url中的动态参数的 @PathVariable用于方法中的参数,表示方法参数绑定到地址URL的模板: 例 @Controller ...

  8. 树形DP总结,持续更新

    自己做了动态规划的题目已经有了一个月,但是成效甚微,所以来总结一下动态规划,希望自己能够温故知新.这个博客是关于树形dp的,动态规划的一类题目. 首先从最简单的树形DP入手,树形DP顾名思义就是一棵树 ...

  9. NEFU 117 - 素数个数的位数 - [简单数学题]

    题目链接:http://acm.nefu.edu.cn/JudgeOnline/problemShow.php?problem_id=117 Time Limit:1000ms Memory Limi ...

  10. ZB api

    本文介绍ZB api Rest API (已开启) ZB为用户提供了一个简单的而又强大的API,旨在帮助用户快速高效的将ZB交易功能整合到自己应用当中. 如果在使用过程中有任何问题,请加群764113 ...