Session procedures

Session procedures dinther Wed, 07/22/2020 - 19:09
Procedure Description Example
sys.setmemorylimit("limit" int) set memory limit in MB for current session. 0 will disable any memory limit. call sys.setmemorylimit(500)
sys.setoptimizer("optimizer" string) change optimizer pipeline for current session call sys.setoptimizer('oltp_pipe')
sys.setprinttimeout("timeout" integer) set print timeout in milliseconds for current session. 0 will disable timing out. call sys.setprinttimeout(1000)
sys.setquerytimeout("query" int) set query execution timeout in milliseconds for current session. 0 will disable timing out. call sys.setquerytimeout(8000)
sys.setsession("timeout" bigint) set session timeout in milliseconds for current session
Warning: This procedure is Deprecated as of Jun2020 (11.37.7). Use sys.setsessiontimeout("timeout") instead.
call sys.setsession(30000)
sys.setsessiontimeout("timeout" int) set session timeout in milliseconds for current session. 0 will disable timing out. call sys.setsessiontimeout(30000)
sys.settimeout("query" bigint) set query timeout in milliseconds for current session
Warning: This procedure is Deprecated as of Jun2020 (11.37.7). Use sys.setquerytimeout("query") instead.
call sys.settimeout(8000)
sys.settimeout("query" bigint, "session" bigint) set query and session timeout in milliseconds for current session
Warning: This procedure is Deprecated as of Jun2020 (11.37.7). Use sys.setquerytimeout("query") and sys.setsessiontimeout("timeout") instead.
call sys.settimeout(8000, 30000)
sys.setworkerlimit("limit" int) set number of worker threads limit for current session. 0 will disable any limit of worker threads. call sys.setworkerlimit(16)

 

Session procedures for monetdb admin user only

To list all sessions info in your MonetDB server first run query: SELECT * FROM sys.sessions;

Procedure Description Example
sys.setmemorylimit(sessionid int, "limit" int) set memory limit in MB for session with sessionid. 0 will disable any memory limit.
You will need monetdb admin privileges.
call sys.setmemorylimit(2, 500)
sys.setoptimizer(sessionid int, "optimizer" string) change optimizer pipeline for session with sessionid.
You will need monetdb admin privileges.
call sys.setoptimizer(2, 'minimal_pipe')
sys.setquerytimeout(sessionid int, "query" int) set query execution timeout in milliseconds for session with sessionid. 0 will disable timing out.
You will need monetdb admin privileges.
call sys.setquerytimeout(2, 8000)
sys.setsessiontimeout(sessionid int, "timeout" int) set session timeout in milliseconds for session with sessionid. 0 will disable timing out.
You will need monetdb admin privileges.
call sys.setsessiontimeout(2, 30000)
sys.setworkerlimit(sessionid int, "limit" int) set number of worker threads limit for session with sessionid. 0 will disable any limit of worker threads.
You will need monetdb admin privileges.
call sys.setworkerlimit(2, 16)
sys.stopsession(sessionid int) stop session with sessionid.
Caution: This procedure stops the specified session which may be undesired.
You will need monetdb admin privileges.
call sys.stopsession(2)