blob: ca5c66b54df79d25f61a8567714a2f367c0599f6 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="copyright" content="(C) Copyright 2023" />
<meta name="DC.rights.owner" content="(C) Copyright 2023" />
<meta name="DC.Type" content="concept" />
<meta name="DC.Title" content="EXEC_TIME_LIMIT_S Query Option (Impala 2.12 or higher only)" />
<meta name="DC.Relation" scheme="URI" content="../topics/impala_set.html" />
<meta name="prodname" content="Impala" />
<meta name="prodname" content="Impala" />
<meta name="version" content="Impala 3.4.x" />
<meta name="version" content="Impala 3.4.x" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="exec_time_limit_s" />
<link rel="stylesheet" type="text/css" href="../commonltr.css" />
<title>EXEC_TIME_LIMIT_S Query Option (Impala 2.12 or higher only)</title>
</head>
<body id="exec_time_limit_s">
<h1 class="title topictitle1" id="ariaid-title1">EXEC_TIME_LIMIT_S Query Option (<span class="keyword">Impala 2.12</span> or higher only)</h1>
<div class="body conbody">
<p class="p">
The <code class="ph codeph">EXEC_TIME_LIMIT_S</code> query option sets a time limit on query execution.
If a query is still executing when time limit expires, it is automatically canceled. The
option is intended to prevent runaway queries that execute for much longer than intended.
</p>
<p class="p">
For example, an Impala administrator could set a default value of
<code class="ph codeph">EXEC_TIME_LIMIT_S=3600</code> for a resource pool to automatically kill queries
that execute for longer than one hour (see
<a class="xref" href="impala_admission.html#admission_control">Admission Control and Query Queuing</a> for information about default query
options). Then, if a user accidentally runs a large query that executes for more than one
hour, it will be automatically killed after the time limit expires to free up resources.
Users can override the default value per query or per session if they do not want the
default <code class="ph codeph">EXEC_TIME_LIMIT_S</code> value to apply to a specific query or a
session.
</p>
<div class="note note"><span class="notetitle">Note:</span>
<p class="p">
The time limit only starts once the query is executing. Time spent planning the query,
scheduling the query, or in admission control is not counted towards the execution time
limit. <code class="ph codeph">SELECT</code> statements are eligible for automatic cancellation until
the client has fetched all result rows. DML queries are eligible for automatic
cancellation until the DML statement has finished.
</p>
</div>
<p class="p">
<strong class="ph b">Syntax:</strong>
</p>
<pre class="pre codeblock"><code>SET EXEC_TIME_LIMIT_S=<var class="keyword varname">seconds</var>;</code></pre>
<p class="p">
<strong class="ph b">Type:</strong> numeric
</p>
<p class="p">
<strong class="ph b">Default:</strong> 0 (no time limit )
</p>
<p class="p">
<strong class="ph b">Added in:</strong> <span class="keyword">Impala 2.12</span>
</p>
<p class="p">
<strong class="ph b">Related information:</strong>
</p>
<p class="p">
<a class="xref" href="impala_timeouts.html#timeouts">Setting Timeout Periods for Daemons, Queries, and Sessions</a>
</p>
</div>
<div class="related-links">
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a class="link" href="../topics/impala_set.html">SET Statement</a></div>
</div>
</div></body>
</html>