Sophie

Sophie

distrib > Fedora > 14 > x86_64 > media > updates > by-pkgid > 71d40963b505df4524269198e237b3e3 > files > 55

virtuoso-opensource-doc-6.1.4-2.fc14.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
 <head profile="http://internetalchemy.org/2003/02/profile">
  <link rel="foaf" type="application/rdf+xml" title="FOAF" href="http://www.openlinksw.com/dataspace/uda/about.rdf" />
  <link rel="schema.dc" href="http://purl.org/dc/elements/1.1/" />
  <meta name="dc.subject" content="SQL" />
  <meta name="dc.subject" content="SQL Reference" />
  <meta name="dc.subject" content="Select" />
  <meta name="dc.subject" content="Update" />
  <meta name="dc.subject" content="delete" />
  <meta name="dc.subject" content="Select Statement" />
  <meta name="dc.subject" content="SQL Syntax" />
  <meta name="dc.subject" content="Syntax" />
  <meta name="dc.title" content="8. SQL Reference" />
  <meta name="dc.subject" content="8. SQL Reference" />
  <meta name="dc.creator" content="OpenLink Software Documentation Team ;&#10;" />
  <meta name="dc.copyright" content="OpenLink Software, 1999 - 2009" />
  <link rel="top" href="index.html" title="OpenLink Virtuoso Universal Server: Documentation" />
  <link rel="search" href="/doc/adv_search.vspx" title="Search OpenLink Virtuoso Universal Server: Documentation" />
  <link rel="parent" href="sqlreference.html" title="Chapter Contents" />
  <link rel="prev" href="SETstmt.html" title="SET Statement" />
  <link rel="next" href="besteffortunion.html" title="Best Effort Union" />
  <link rel="shortcut icon" href="../images/misc/favicon.ico" type="image/x-icon" />
  <link rel="stylesheet" type="text/css" href="doc.css" />
  <link rel="stylesheet" type="text/css" href="/doc/translation.css" />
  <title>8. SQL Reference</title>
  <meta http-equiv="Content-Type" content="text/xhtml; charset=UTF-8" />
  <meta name="author" content="OpenLink Software Documentation Team ;&#10;" />
  <meta name="copyright" content="OpenLink Software, 1999 - 2009" />
  <meta name="keywords" content="SQL; SQL Reference; Select; Update; delete; Select Statement; SQL Syntax; Syntax; " />
  <meta name="GENERATOR" content="OpenLink XSLT Team" />
 </head>
 <body>
  <div id="header">
    <a name="anytimequeries" />
    <img src="../images/misc/logo.jpg" alt="" />
    <h1>8. SQL Reference</h1>
  </div>
  <div id="navbartop">
   <div>
      <a class="link" href="sqlreference.html">Chapter Contents</a> | <a class="link" href="SETstmt.html" title="SET Statement">Prev</a> | <a class="link" href="besteffortunion.html" title="Best Effort Union">Next</a>
   </div>
  </div>
  <div id="currenttoc">
   <form method="post" action="/doc/adv_search.vspx">
    <div class="search">Keyword Search: <br />
        <input type="text" name="q" /> <input type="submit" name="go" value="Go" />
    </div>
   </form>
   <div>
      <a href="http://www.openlinksw.com/">www.openlinksw.com</a>
   </div>
   <div>
      <a href="http://docs.openlinksw.com/">docs.openlinksw.com</a>
   </div>
    <br />
   <div>
      <a href="index.html">Book Home</a>
   </div>
    <br />
   <div>
      <a href="contents.html">Contents</a>
   </div>
   <div>
      <a href="preface.html">Preface</a>
   </div>
    <br />
   <div class="selected">
      <a href="sqlreference.html">SQL Reference</a>
   </div>
    <br />
   <div>
      <a href="sqlrefDATATYPES.html">Datatypes</a>
   </div>
   <div>
      <a href="udt.html">User Defined Types</a>
   </div>
   <div>
      <a href="sqlrefxmldatatype.html">XML Column Type</a>
   </div>
   <div>
      <a href="catidentifiers.html">Identifier Case &amp; Quoting</a>
   </div>
   <div>
      <a href="wideidentifiers.html">Wide Character Identifiers</a>
   </div>
   <div>
      <a href="QUALIFIEDNAMES.html">Qualified Names</a>
   </div>
   <div>
      <a href="litsbraceescs.html">Literals, Brace Escapes</a>
   </div>
   <div>
      <a href="CREATETABLE.html">CREATE TABLE Statement</a>
   </div>
   <div>
      <a href="DROPTABLE.html">DROP TABLE Statement</a>
   </div>
   <div>
      <a href="CREATEINDEX.html">CREATE INDEX Statement</a>
   </div>
   <div>
      <a href="DROPINDEX.html">DROP INDEX Statement</a>
   </div>
   <div>
      <a href="ALTERTABLE.html">ALTER TABLE Statement</a>
   </div>
   <div>
      <a href="CREATEVIEW.html">CREATE VIEW Statement</a>
   </div>
   <div>
      <a href="CREATEXMLSCHEMA.html">CREATE XML SCHEMA Statement</a>
   </div>
   <div>
      <a href="DROPXMLSCHEMA.html">DROP XML SCHEMA Statement</a>
   </div>
   <div>
      <a href="sequenceobjects.html">Sequence Objects</a>
   </div>
   <div>
      <a href="insertSTMT.html">INSERT Statement</a>
   </div>
   <div>
      <a href="updatestmt.html">UPDATE Statement</a>
   </div>
   <div>
      <a href="SELECTSTMT.html">SELECT Statement</a>
   </div>
   <div>
      <a href="COMMIT_ROLLBACK.html">COMMIT WORK, ROLLBACK WORK Statement</a>
   </div>
   <div>
      <a href="CHECKPOINT.html">CHECKPOINT, SHUTDOWN Statement</a>
   </div>
   <div>
      <a href="spasviewsandtables.html">Stored Procedures as Views &amp; Derived Tables</a>
   </div>
   <div>
      <a href="GRANT.html">GRANT, REVOKE Statement</a>
   </div>
   <div>
      <a href="SETstmt.html">SET Statement</a>
   </div>
   <div class="selected">
      <a href="anytimequeries.html">Anytime Queries</a>
   </div>
   <div>
      <a href="besteffortunion.html">Best Effort Union</a>
   </div>
   <div>
      <a href="aggregates.html">Standard and User-Defined Aggregate Functions</a>
   </div>
   <div>
      <a href="sqloptimizer.html">Virtuoso SQL Optimization</a>
   </div>
   <div>
      <a href="sqlinverse.html">SQL Inverse Functions</a>
   </div>
   <div>
      <a href="GRAMMAR.html">SQL Grammar</a>
   </div>
   <div>
      <a href="BITMAPINDICES.html">Bitmap Indices</a>
   </div>
   <div>
      <a href="transitivityinsQL.html">Transitivity in SQL</a>
   </div>
   <div>
      <a href="sqlreffastphrasematch.html">Fast Phrase Match Processor</a>
   </div>
    <br />
  </div>
  <div id="text">
		<a name="anytimequeries" />
    <h2>8.25. Anytime Queries</h2>
     <p>Starting with version 6, Virtuoso offers a partial query evaluation feature that guarantees
answers to arbitrary queries within a fixed time. This is intended for use in  publicly available SPARQL
or SQL end points on large databases. This enforces a finite duration to all queries and will strive to
return meaningful partial results. Thus this provides the same security as a transaction timeout but will
be more user friendly since results will generally be returned, also for aggregate queries. Outside of a
public query service, this may also be handy when exploring a large data set with unknown properties.
</p>
<p>The feature is activated with the statement</p>
<div>
      <pre class="programlisting">
set result_timeout == &lt;expression&gt;;
</pre>
    </div>
     <p>The expression should be a count of milliseconds. The scope of the setting is the connection,
thus it remains in effect past the return of the calling procedure. Setting the timeout to 0 returns to the
default state of having no limit on query run time and always returning complete results. The initial value
of the timeout is 0. On a web server thread, the timeout is reset to 0 at the start of processing each
new request header.
</p>
<p>After a query or cursor has exceeded the running time, it is reset.
In the event of the reset occurring inside an aggregation, the part
of the query that produces rows for the aggregation is terminated, the
timeout is reset and the query continues by using the aggregated
results that were obtained before the first timeout. If there is
again a timeout, the present aggregation is reset and the query gets
another lease on life for processing the results accumulated so far.
Thus, a query which has a select, a group by and an order by can
consume at most three timeouts. One for producing the aggregated
rows, another for sorting them and finally a third for returning them
to a client or iterating over them in a stored procedure.
</p>
<p>If the timeout occurs outside an aggregation, the result set is simply truncated.</p>
<p>The fact of a query returning partial results is indicated by the
result set ending with a S1TAT SQL state. If the result set is read
to end without this state being signalled, the results are complete
and the query was not interrupted. If the result set is not consumed
to end, the client cannot be sure of its completeness.
</p>
<p>The error message associated with the S1TAT state contains the human
readable version of the output of db_activity () for the query. If
result_timeout is non-zero, the opening of a cursor or execution of a
query on a client connection or with the exec () function will reset
the client resource consumption counters automatically. This is done
so as to have the resource consumption statistics for the error
message scoped to the query. To get the exact counts, the application
may call db_activity (1) in the same procedure. If this is called on
a client server connection with the timeout on, the counts will be
reset before db_activity () is called.
</p>
     <p>The resolution of the timeout is fairly low, timeouts are checked every two seconds with default
settings.</p>
     <p>A query cannot set a timeout from inside itself. Only a stored procedure or a top level statement
on a client connection can do this.</p>
     <p>A request to SPARQL web service endpoint may specify the timeout as an additoional <strong>&amp;timeout=&lt;milliseconds&gt;</strong> parameter.
The parameter value should be equal to or greater than 1000, otherwise it will be ignored.
If <strong>SPARQL</strong> Virtuoso configuration file contains
<strong>MaxQueryExecutionTime</strong> parameter and its value is greater than or equal to 1000
then the actual &quot;anytime&quot; timeout is the minimum of the requested value and the value in the configuration file.
</p>
     <p>The current standard of SPARQL protocol does not provide any support for partial results.
When a SPARQL query ends with S1TAT state, the returned HTTP header contains four additional rows,
<strong>X-SQL-State:</strong>, <strong>X-SQL-Message:</strong>, <strong>X-Exec-Milliseconds:</strong> and
<strong>X-Exec-DB-Activity:</strong>; the returned document is formatted according to the requested MIME type as if the result is complete.</p>
 	<table border="0" width="90%" id="navbarbottom">
    <tr>
        <td align="left" width="33%">
          <a href="SETstmt.html" title="SET Statement">Previous</a>
          <br />SET Statement</td>
     <td align="center" width="34%">
          <a href="sqlreference.html">Chapter Contents</a>
     </td>
        <td align="right" width="33%">
          <a href="besteffortunion.html" title="Best Effort Union">Next</a>
          <br />Best Effort Union</td>
    </tr>
    </table>
  </div>
  <div id="footer">
    <div>Copyright© 1999 - 2009 OpenLink Software All rights reserved.</div>
   <div id="validation">
    <a href="http://validator.w3.org/check/referer">
        <img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" />
    </a>
    <a href="http://jigsaw.w3.org/css-validator/">
        <img src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" height="31" width="88" />
    </a>
   </div>
  </div>
 </body>
</html>