zoukankan      html  css  js  c++  java
  • postgresql 控制命令执行时长 statement_timeout

    statement_timeout 在 postgresql 被用来控制语句执行时长,单位是ms。

    $ vi postgresql.conf 
    #statement_timeout = 0                  # in milliseconds, 0 is disabled

    默认是0,表示语句可以一直执行下去。

    如果设置为1440000,那就意味着语句最多可以执行 1440000ms = 1440s = 24min。
    建议设置为0,禁用该参数。

    postgres=# select *
    postgres-# from pg_settings ps
    postgres-# where 1=1
    postgres-# and ps.name like '%statement_timeout%'
    postgres-# ;
    -[ RECORD 1 ]---------------------------------------------------
    name       | statement_timeout
    setting    | 1440000
    unit       | ms
    category   | Client Connection Defaults / Statement Behavior
    short_desc | Sets the maximum allowed duration of any statement.
    extra_desc | A value of 0 turns off the timeout.
    context    | user
    vartype    | integer
    source     | configuration file
    min_val    | 0
    max_val    | 2147483647
    enumvals   | 
    boot_val   | 0
    reset_val  | 14400000
    sourcefile | /etc/postgresql/9.1/main/postgresql.conf
    sourceline | 473
  • 相关阅读:
    c#配置文件
    C#预处理指令
    C#面向对象详解
    231. Power of Two
    226. Invert Binary Tree
    C语言函数入参压栈顺序为什么是从右向左?
    对C++ 虚函数的理解
    悲观锁和乐观锁
    什么是索引
    CHAR 和VARCHAR的区别
  • 原文地址:https://www.cnblogs.com/ctypyb2002/p/9793044.html
Copyright © 2011-2022 走看看