<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://sqlzoo.net/w/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://sqlzoo.net/w/index.php?title=Set_a_timeout.&amp;feed=atom&amp;action=history</id>
		<title>Set a timeout. - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://sqlzoo.net/w/index.php?title=Set_a_timeout.&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://sqlzoo.net/w/index.php?title=Set_a_timeout.&amp;action=history"/>
		<updated>2013-05-20T12:56:02Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.20.4</generator>

	<entry>
		<id>http://sqlzoo.net/w/index.php?title=Set_a_timeout.&amp;diff=1504&amp;oldid=prev</id>
		<title>Connor: Created page with &quot;Set a timeout. &lt;div class='ht'&gt; &lt;div class=params&gt;schema:gisq&lt;/div&gt; &lt;div&gt; Users may accidentally (or deliberately) start queries which would take a very long time to complete....&quot;</title>
		<link rel="alternate" type="text/html" href="http://sqlzoo.net/w/index.php?title=Set_a_timeout.&amp;diff=1504&amp;oldid=prev"/>
				<updated>2012-07-17T13:33:12Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;Set a timeout. &amp;lt;div class=&amp;#039;ht&amp;#039;&amp;gt; &amp;lt;div class=params&amp;gt;schema:gisq&amp;lt;/div&amp;gt; &amp;lt;div&amp;gt; Users may accidentally (or deliberately) start queries which would take a very long time to complete....&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Set a timeout.&lt;br /&gt;
&amp;lt;div class='ht'&amp;gt;&lt;br /&gt;
&amp;lt;div class=params&amp;gt;schema:gisq&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
Users may accidentally (or deliberately) start queries which would take a very long time to complete. &lt;br /&gt;
We can set a 'timeout'; this means that the system gives up after a certain amount of time. &lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;source lang=sql class='tidy'&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=sql class='setup'&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang='sql' class='def e-sqlite'&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang='sql' class='def e-db2'&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang='sql' class='def e-ingres'&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang='sql' class='def e-access'&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang='sql' class='def e-postgres'&amp;gt;SET STATEMENT_TIMEOUT TO 60000&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang='sql' class='def e-oracle'&amp;gt;ALTER SYSTEM SET RESOURCE_LIMIT=TRUE;&lt;br /&gt;
CREATE PROFILE gisqprofile&lt;br /&gt;
   LIMIT CONNECT_TIME 1&lt;br /&gt;
   ;&lt;br /&gt;
ALTER USER scott PROFILE gisqprofile;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang='sql' class='def e-sqlserver'&amp;gt;sp_configure 'show advanced options', 1;&lt;br /&gt;
reconfigure;&lt;br /&gt;
sp_configure 'query governor cost limit', 60;&lt;br /&gt;
reconfigure;&lt;br /&gt;
sp_configure 'show advanced options', 0&lt;br /&gt;
reconfigure&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang='sql' class='def e-mysql'&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang='sql' class='def e-mimer'&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang='sql' class='def e-sybase'&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;ecomm e-postgres&amp;quot; style=&amp;quot;display: none&amp;quot;&amp;gt;In SQL you can set the session-wide timeout&lt;br /&gt;
 SET STATEMENT_TIMEOUT TO 60000&lt;br /&gt;
You can specify a limit from the system in postgresql.conf&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;ecomm e-oracle&amp;quot; style=&amp;quot;display: none&amp;quot;&amp;gt;The user scott is limited to 1 minute per connection. After this time he will be logged out, if he is running a query it will be abandoned.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;ecomm e-sqlserver&amp;quot; style=&amp;quot;display: none&amp;quot;&amp;gt;The system estimates the time to complete the query before executing it. If this estimate is more than 60 then the query will not be attempted. This applies to all queries. Individual queries may override this value using the SET QUERY_GOVERNOR_COST_LIMIT command.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
{{Users ref}}&lt;/div&gt;</summary>
		<author><name>Connor</name></author>	</entry>

	</feed>