SET SESSION RUNTIMECAP

Sets the maximum amount of time queries can run in a give session. If a query exceeds its session's RUNTIMECAP setting, Vertica terminates the query and returns an error. You cannot increase the RUNTIMECAP beyond the limit that is set in your user profile.

Note: Vertica does not strictly enforce session RUNTIMECAP settings. If you time a query, you might discover that it runs longer than the RUNTIMECAP setting.

Syntax

SET SESSION RUNTIMECAP duration

Parameters

duration

Specifies how long a given query can run in the current session, one of the following:

  • NONE (default): Removes a runtime limit for all current session queries.
  • 'interval': Specifies as an interval the maximum runtime for current session queries, up to one year—for example, 1 minute or 100 seconds.
  • =DEFAULT: Sets maximum runtime for queries in this session to the user's RUNTIMECAP value.

Privileges

Examples

Set the maximum query runtime for the current session to 10 minutes: 

=> SET SESSION RUNTIMECAP '10 minutes';

Revert the session RUNTIMECAP to your user default setting:

=> SET SESSION RUNTIMECAP =DEFAULT;
SET
=> SHOW RUNTIMECAP;
    name    |  setting
------------+-----------
 runtimecap | UNLIMITED
(1 row)