Session Procedures

ProcedureDescriptionExample
sys.setmemorylimit(limit int)set query execution memory limit in MB for current session. 0 will disable any query memory limit.call sys.setmemorylimit(500);
sys.setoptimizer(optimizer string)change optimizer pipeline for current sessioncall sys.setoptimizer('minimal_pipe');
sys.setprinttimeout(timeout int)Print long running queries every so many minutes to log file for current session. 0 will disable print timeout.call sys.setprinttimeout(6);
sys.setquerytimeout(timeout int)set query execution timeout in seconds for current session. 0 will disable timing out.call sys.setquerytimeout(8);
sys.setsessiontimeout(timeout int)set session timeout in seconds for current session. 0 will disable timing out.call sys.setsessiontimeout(30);
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 admin users only

ProcedureDescriptionExample
sys.setmemorylimit(sessionid int, limit int)set query execution memory limit in MB for specified session. 0 will disable any memory limit.call sys.setmemorylimit(4, 500);
sys.setoptimizer(sessionid int, optimizer string)change optimizer pipeline for specified sessioncall sys.setoptimizer(4, 'sequential_pipe');
sys.setquerytimeout(sessionid int, timeout int)set query execution timeout in seconds for specified session. 0 will disable timing out.call sys.setquerytimeout(4, 8);
sys.setsessiontimeout(sessionid int, timeout int)set session timeout in seconds for specified session. 0 will disable timing out.call sys.setsessiontimeout(4, 30);
sys.setworkerlimit(sessionid int, limit int)set number of worker threads limit for specified session. 0 will disable any limit of worker threads.call sys.setworkerlimit(4, 16);
sys.stopsession(sessionid int)stops the specified session. Use with caution.call sys.stopsession(4);

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

To get your current sessionid value run query: SELECT sys.current_sessionid();