<?xml version="1.0" encoding="ISO-8859-1" ?>
<rss version="2.0">
 <channel>
  <title>SQL Reference</title>
  <link>http://docs.openlinksw.com/virtuoso/sqlreference.html</link>
  <description>OpenLink Virtuoso Universal Server: Documentation</description>
  <managingEditor>virtuoso.docs@openlinksw.com</managingEditor>
  <pubDate>Tue, 09 Sep 2008 11:44:52 GMT</pubDate>
  <generator>OpenLink Software Documentation Team</generator>
  <webMaster>webmaster@openlinksw.com</webMaster>
  <image>
    <title>OpenLink Virtuoso Universal Server: Documentation</title>
    <url>http://docs.openlinksw.com/virtuoso/../images/misc/logo.jpg</url>
    <link>http://docs.openlinksw.com/virtuoso/sqlreference.html</link>
    <description>OpenLink Virtuoso Universal Server: Documentation</description>
  </image>
  <item>
    <guid>http://docs.openlinksw.com/virtuoso/sqlrefDATATYPES.html</guid>
    <author>virtuoso.docs@openlinksw.com</author>
    <category>Datatypes</category>
    <link>http://docs.openlinksw.com/virtuoso/sqlrefDATATYPES.html</link>
    <pubDate>Tue, 09 Sep 2008 11:44:52 GMT</pubDate>
    <title>Datatypes</title>
    <description />
  </item>
  <item>
    <guid>http://docs.openlinksw.com/virtuoso/udt.html</guid>
    <author>virtuoso.docs@openlinksw.com</author>
    <category>User Defined Types</category>
    <link>http://docs.openlinksw.com/virtuoso/udt.html</link>
    <pubDate>Tue, 09 Sep 2008 11:44:52 GMT</pubDate>
    <title>User Defined Types</title>
    <description>A user-defined type is a schema object, identified by a user-defined
type name.  The definition of a user-defined type specifies a number of
components, including in particular a list of attribute definitions.  The
representation of a user-defined type is expressed as a list of attribute
definitions.

The definition of a user-defined type may include a method specification
list consisting of one or more method specifications.  A method specification
is either an original method specification or an overriding method
specification.  Each original method specification specifies the method name,
the SQL parameter declaration list, the returns data type, the &lt;language clause&gt;,
the language (if the language is not SQL), and whether it is a STATIC or
CONSTRUCTOR method.

Each overriding method specification specifies the method name, the SQL
parameter declaration list and the RETURNS data type.  For each overriding method
specification, there must be an original method specification with the same
method name and SQL parameter declaration list in some proper supertype of
the user-defined type.  Every SQL-invoked method in a schema must correspond to
exactly one original method specification or overriding method specification
associated with some user-defined type existing in that schema.  A
method M that corresponds to an original method
specification in the definition of a structured type T1
is an original method of T1. A
method M that corresponds to an overriding
method specification in the definition of T1 is
an overriding method of T1.  A method
M is a method of type
T1 if one of the following holds:

</description>
  </item>
  <item>
    <guid>http://docs.openlinksw.com/virtuoso/sqlrefxmldatatype.html</guid>
    <author>virtuoso.docs@openlinksw.com</author>
    <category>XML Column Type</category>
    <link>http://docs.openlinksw.com/virtuoso/sqlrefxmldatatype.html</link>
    <pubDate>Tue, 09 Sep 2008 11:44:52 GMT</pubDate>
    <title>XML Column Type</title>
    <description>Virtuoso allows for native XML storage in a database table column using
  the LONG XML type.  This data type is
  a variation of LONG VARCHAR that can have
  plain text or XML entities, persistent or non-persistent values, but will always
  return an XML entity when selected.  

Since ODBC does not support an XML entity type this column will appear
  as a LONG VARCHAR when selected from ODBC based clients.

</description>
  </item>
  <item>
    <guid>http://docs.openlinksw.com/virtuoso/catidentifiers.html</guid>
    <author>virtuoso.docs@openlinksw.com</author>
    <category>Identifier Case &amp; Quoting</category>
    <link>http://docs.openlinksw.com/virtuoso/catidentifiers.html</link>
    <pubDate>Tue, 09 Sep 2008 11:44:52 GMT</pubDate>
    <title>Identifier Case &amp; Quoting</title>
    <description>Virtuoso can operate with different identifier case conventions.
The CaseMode setting in the virtuoso.ini file controls this, see the
virtuoso.ini configuration section of
the documentation.

The default files supplied with Virtuoso specify a CaseMode of 2,
which is a case insensitive mode that preserves the declaration case of identifiers.



A CaseMode of 1 specifies the upper case mode, which is most
commonly used in SQL databases, e.g. Oracle.
In the upper case mode, all unquoted identifiers are converted to upper
case by the SQL parser. If identifiers are not quoted, the case in which
they are entered is irrelevant.


</description>
  </item>
  <item>
    <guid>http://docs.openlinksw.com/virtuoso/wideidentifiers.html</guid>
    <author>virtuoso.docs@openlinksw.com</author>
    <category>Wide Character Identifiers</category>
    <link>http://docs.openlinksw.com/virtuoso/wideidentifiers.html</link>
    <pubDate>Tue, 09 Sep 2008 11:44:52 GMT</pubDate>
    <title>Wide Character Identifiers</title>
    <description>All Virtuoso schema columns are confined to 8-bit character fields.  This will
remain for backwards compatibility and performance reasons, however, there
are two options available for support of non-ASCII identifier names as follows:

Virtuoso supports the above cases which are switchable through the
&quot;SQL_UTF8_EXECS&quot; = 1/0 flag in the [Client] section of the Virtuoso INI file.
Setting SQL_UTF8_EXECS = 1 enables UTF-8 identifier storage and retrieval,
whereas setting SQL_UTF8_EXECS = 0 disables it.  The default setting is 0: disabled
for backwards compatible option.

When an SQL statement comes into the driver(s) it is expanded into unicode (using
either the current database character set if it is a narrow string like in
SQLExecDirect, or taking it verbatim as in SQLExecDirectW).  The unicode
string is then encoded into UTF-8 passed to the SQL parser.  The SQL parser knows
that it will receive UTF-8 so it takes that into account when parsing the
national character literals (N&#39;&lt;literal&gt;&#39;) and the &quot;normal&quot; literals (&#39;&lt;literal&gt;&#39;).
It will however return identifier names in UTF-8, these will then get stored into
the DBMS system tables or compared against them depending on the type of statement.

</description>
  </item>
  <item>
    <guid>http://docs.openlinksw.com/virtuoso/QUALIFIEDNAMES.html</guid>
    <author>virtuoso.docs@openlinksw.com</author>
    <category>Qualified Names</category>
    <link>http://docs.openlinksw.com/virtuoso/QUALIFIEDNAMES.html</link>
    <pubDate>Tue, 09 Sep 2008 11:44:52 GMT</pubDate>
    <title>Qualified Names</title>
    <description />
  </item>
  <item>
    <guid>http://docs.openlinksw.com/virtuoso/litsbraceescs.html</guid>
    <author>virtuoso.docs@openlinksw.com</author>
    <category>Literals, Brace Escapes</category>
    <link>http://docs.openlinksw.com/virtuoso/litsbraceescs.html</link>
    <pubDate>Tue, 09 Sep 2008 11:44:52 GMT</pubDate>
    <title>Literals, Brace Escapes</title>
    <description />
  </item>
  <item>
    <guid>http://docs.openlinksw.com/virtuoso/CREATETABLE.html</guid>
    <author>virtuoso.docs@openlinksw.com</author>
    <category>CREATE TABLE Statement</category>
    <link>http://docs.openlinksw.com/virtuoso/CREATETABLE.html</link>
    <pubDate>Tue, 09 Sep 2008 11:44:52 GMT</pubDate>
    <title>CREATE TABLE Statement</title>
    <description />
  </item>
  <item>
    <guid>http://docs.openlinksw.com/virtuoso/DROPTABLE.html</guid>
    <author>virtuoso.docs@openlinksw.com</author>
    <category>DROP TABLE Statement</category>
    <link>http://docs.openlinksw.com/virtuoso/DROPTABLE.html</link>
    <pubDate>Tue, 09 Sep 2008 11:44:52 GMT</pubDate>
    <title>DROP TABLE Statement</title>
    <description>
This statement drops a table. This requires dba privileges or ownership of the
table.  Any subtables are automatically dropped.  Supertables are not affected.


</description>
  </item>
  <item>
    <guid>http://docs.openlinksw.com/virtuoso/CREATEINDEX.html</guid>
    <author>virtuoso.docs@openlinksw.com</author>
    <category>CREATE INDEX Statement</category>
    <link>http://docs.openlinksw.com/virtuoso/CREATEINDEX.html</link>
    <pubDate>Tue, 09 Sep 2008 11:44:52 GMT</pubDate>
    <title>CREATE INDEX Statement</title>
    <description>This creates an index on a table.  Index names must be unique across a
  qualifier.  The ascending / descending column attributes are recognized for
  compatibility but do not have any effect.  The index is defined and populated
  at the execution of the statement.  Pre-existing stored procedures and
  prepared statements will make use of the new index when appropriate.

The UNIQUE attribute enforces uniqueness of the specified columns
  across the table and subtables where the index is visible.

The CLUSTERED attribute is not recommended.  It will cause keys to be
  unprefixed by key id, thus causing the key entries to be intermixed with
  entries of other CLUSTERED indices with adjacent values of key parts.

</description>
  </item>
  <item>
    <guid>http://docs.openlinksw.com/virtuoso/DROPINDEX.html</guid>
    <author>virtuoso.docs@openlinksw.com</author>
    <category>DROP INDEX Statement</category>
    <link>http://docs.openlinksw.com/virtuoso/DROPINDEX.html</link>
    <pubDate>Tue, 09 Sep 2008 11:44:52 GMT</pubDate>
    <title>DROP INDEX Statement</title>
    <description>This will drop an index, dba privileges or table ownership are required.
  A table&#39;s primary key which has the same name as the table can not be dropped.

Optionally, a table name can be given if the index name is not unique.
  The table name may be qualified.

</description>
  </item>
  <item>
    <guid>http://docs.openlinksw.com/virtuoso/ALTERTABLE.html</guid>
    <author>virtuoso.docs@openlinksw.com</author>
    <category>ALTER TABLE Statement</category>
    <link>http://docs.openlinksw.com/virtuoso/ALTERTABLE.html</link>
    <pubDate>Tue, 09 Sep 2008 11:44:52 GMT</pubDate>
    <title>ALTER TABLE Statement</title>
    <description>The ALTER TABLE statement adds or drops columns and renames tables.

Adding or dropping a column of a table will create a new version of the
  table&#39;s schema entry.  The rows of the altered table will be changed to
  conform to the new definition when next updated.  All newly inserted rows
  will be in the new row layout.  This means that ALTER TABLE itself executes in
  fixed time without locking the table.  The time to update the actual data
  will be spread over subsequent updates.

An added column will have a NULL value on those rows where the
  new column has not been set.  A possible default will only apply to newly
  inserted rows.

</description>
  </item>
  <item>
    <guid>http://docs.openlinksw.com/virtuoso/CREATEVIEW.html</guid>
    <author>virtuoso.docs@openlinksw.com</author>
    <category>CREATE VIEW Statement</category>
    <link>http://docs.openlinksw.com/virtuoso/CREATEVIEW.html</link>
    <pubDate>Tue, 09 Sep 2008 11:44:52 GMT</pubDate>
    <title>CREATE VIEW Statement</title>
    <description />
  </item>
  <item>
    <guid>http://docs.openlinksw.com/virtuoso/CREATEXMLSCHEMA.html</guid>
    <author>virtuoso.docs@openlinksw.com</author>
    <category>CREATE XML SCHEMA Statement</category>
    <link>http://docs.openlinksw.com/virtuoso/CREATEXMLSCHEMA.html</link>
    <pubDate>Tue, 09 Sep 2008 11:44:52 GMT</pubDate>
    <title>CREATE XML SCHEMA Statement</title>
    <description>
Virtuoso supports registering XML Schemas for use in
WITH SCHEMA
constraint for column values. The statement contains the whole text of the schema as a
string constant, i.e. enclosed in single quotes. This is not the best possible syntax,
because single quotes inside the text of schema should be carefully quoted, but this is
de-facto standard. If the schema contains number of single quotes (e.g. attributes are
in single quotes instead of typically used double quotes), try a system stored procedure

DB.DBA.SYS_CREATE_XML_SCHEMA (text_of_schema);

that will have the same effect, but is not portable.



In principle, you can register any valid XMLSchema, but some features can cause prohibitive loss of performance.
It is strongly advised to compose the schema as a &quot;standalone&quot; document that has no references to
external DTDs or external generic entities. It is also strongly advised to avoid xs:include and
xs:import directives. The only sort of external references that does not affect performance is
xs:include or xs:import of a registered &quot;sibling&quot; schema. They say that a schema X is a &quot;sibling&quot; of schema Y
if their target namespace URIs have identical protocol names and host names and differs only in local path,
and schema X imports Y using relative (not absolute!) URI that contain only relative path,
(no protocol and no host).


</description>
  </item>
  <item>
    <guid>http://docs.openlinksw.com/virtuoso/DROPXMLSCHEMA.html</guid>
    <author>virtuoso.docs@openlinksw.com</author>
    <category>DROP XML SCHEMA Statement</category>
    <link>http://docs.openlinksw.com/virtuoso/DROPXMLSCHEMA.html</link>
    <pubDate>Tue, 09 Sep 2008 11:44:52 GMT</pubDate>
    <title>DROP XML SCHEMA Statement</title>
    <description>
This reverts the effect of CREATE XML SCHEMA.


The &lt;target URI&gt; should be a string constant that is equal to the value of
&quot;targetNamespace&quot; attribute of &quot;xs:schema&quot; element of a previously declared XML schema.


The statement signals an error if the XMLSchema to be dropped is used in some WITH SCHEMA constraint.

</description>
  </item>
  <item>
    <guid>http://docs.openlinksw.com/virtuoso/sequenceobjects.html</guid>
    <author>virtuoso.docs@openlinksw.com</author>
    <category>Sequence Objects</category>
    <link>http://docs.openlinksw.com/virtuoso/sequenceobjects.html</link>
    <pubDate>Tue, 09 Sep 2008 11:44:52 GMT</pubDate>
    <title>Sequence Objects</title>
    <description>
Virtuoso supports sequence objects. These can be used to generate sequential
numbers which can be used as unique identifiers.  A sequence object is
guaranteed never to give the same number twice.  Each sequence has a
name and a state. The state of a sequence is stored in the database at
checkpoint time. Between checkpoints sequence states are logged so that
a possible roll forward recovery will not lose information.



The SQL functions sequence_next() and sequence_set() are used to access
and set the state of sequences.  These take the name of the sequence as
argument.  This is a server/wide unique string. There are no restrictions
on the length or character set of the sequence



Sequences do not have to be separately created.  A sequence object
will automatically be generated when first referenced by sequence_next()
or sequence_set.


</description>
  </item>
  <item>
    <guid>http://docs.openlinksw.com/virtuoso/insertSTMT.html</guid>
    <author>virtuoso.docs@openlinksw.com</author>
    <category>INSERT Statement</category>
    <link>http://docs.openlinksw.com/virtuoso/insertSTMT.html</link>
    <pubDate>Tue, 09 Sep 2008 11:44:52 GMT</pubDate>
    <title>INSERT Statement</title>
    <description>
New rows (or records) are entered into a database using the INSERT statement.



If you have to enter a NULL you can simply use the keyword NULL, as you would a normal value.  Since
NULL is a special keyword you do not need to enclose it in single quotes.



You can specify the columns that you are inserting values into in the insert statement.  One
should always specify the columns that you are inserting into, in case the order of columns in
the database are not as expected, or you are not inserting values into every column.


</description>
  </item>
  <item>
    <guid>http://docs.openlinksw.com/virtuoso/updatestmt.html</guid>
    <author>virtuoso.docs@openlinksw.com</author>
    <category>UPDATE Statement</category>
    <link>http://docs.openlinksw.com/virtuoso/updatestmt.html</link>
    <pubDate>Tue, 09 Sep 2008 11:44:52 GMT</pubDate>
    <title>UPDATE Statement</title>
    <description>Existing rows (or records) are changed in the database using the UPDATE statement.

NULL values can be utilized using the NULL keyword without
		any quotes.  Since NULL is a special keyword you do not need to enclose it in single quotes, doing so
		will cause it be read as a string-literal.

The update statement is made up by selecting the table to update, the search condition that
		identifies which rows you want to update, and the column=value
		of each column you wish to change.  

</description>
  </item>
  <item>
    <guid>http://docs.openlinksw.com/virtuoso/SELECTSTMT.html</guid>
    <author>virtuoso.docs@openlinksw.com</author>
    <category>SELECT Statement</category>
    <link>http://docs.openlinksw.com/virtuoso/SELECTSTMT.html</link>
    <pubDate>Tue, 09 Sep 2008 11:44:52 GMT</pubDate>
    <title>SELECT Statement</title>
    <description />
  </item>
  <item>
    <guid>http://docs.openlinksw.com/virtuoso/COMMIT_ROLLBACK.html</guid>
    <author>virtuoso.docs@openlinksw.com</author>
    <category>COMMIT WORK, ROLLBACK WORK Statement</category>
    <link>http://docs.openlinksw.com/virtuoso/COMMIT_ROLLBACK.html</link>
    <pubDate>Tue, 09 Sep 2008 11:44:52 GMT</pubDate>
    <title>COMMIT WORK, ROLLBACK WORK Statement</title>
    <description>
These statements reset the current transaction.  COMMIT WORK leaves all the changes made
by the current transaction in effect whereas ROLLBACK work reverses them.



In both cases, the transaction will be in a fresh state, having no locks and
no changes that could be rolled back.  The rollback operation always succeeds, as any
change is always reversible until committed.  COMMIT WORK may fail if the
transaction had been marked to be canceled before the COMMIT WORK operation started.  A failed
commit has the effect of a rollback but it will signal a SQL STATE descriptive of
the error, e.g. 40001 (deadlock).



These operations are typically not needed, since the SQLTransact ODBC call and the ODBC
autocommit mode are used instead for transaction control.  The only use for
these statements is within stored procedures, where it may be practical to break
a long sequence of operations into several transactions to reduce lock contention.


</description>
  </item>
  <item>
    <guid>http://docs.openlinksw.com/virtuoso/CHECKPOINT.html</guid>
    <author>virtuoso.docs@openlinksw.com</author>
    <category>CHECKPOINT, SHUTDOWN Statement</category>
    <link>http://docs.openlinksw.com/virtuoso/CHECKPOINT.html</link>
    <pubDate>Tue, 09 Sep 2008 11:44:52 GMT</pubDate>
    <title>CHECKPOINT, SHUTDOWN Statement</title>
    <description>
The checkpoint is a point in the history of a database where all
the state is written on disk as a single, consistent image that contains all
the state committed so far and no uncommitted state.  A transaction log starts after a checkpoint
and contains the information to allow the recreation of the effect of transactions
committed since the checkpoint.  The checkpoint state and the transaction
log together allow recovering the database up to the last committed transaction.



The CHECKPOINT statement forces a checkpoint to be made. Making the checkpoint
allows starting a new transaction log.
If no new log name is specified the old log is truncated to length 0 and reused
for logging transactions.  If the CheckpointAuditTrail option is enabled in
virtuoso.ini a new log will be started even if no new log is specified in the checkpoint
or shutdown statement.



The SHUTDOWN statement performs a CHECKPOINT, and terminates the server upon
completion.


</description>
  </item>
  <item>
    <guid>http://docs.openlinksw.com/virtuoso/spasviewsandtables.html</guid>
    <author>virtuoso.docs@openlinksw.com</author>
    <category>Stored Procedures as Views &amp; Derived Tables</category>
    <link>http://docs.openlinksw.com/virtuoso/spasviewsandtables.html</link>
    <pubDate>Tue, 09 Sep 2008 11:44:52 GMT</pubDate>
    <title>Stored Procedures as Views &amp; Derived Tables</title>
    <description>
Virtuoso allows using a stored procedure result set in place of a table. A view may also be
defined as a stored procedure. This provides smooth integration to external
procedural logic in queries.



When a procedure appears as a table, the procedure is called and its result set is inserted
into a temporary space. Processing continues from that point on as if the data came from a table.



Queries involving procedure views or derived tables are subject to normal join order selection.
For this purpose it is possible to associate a cost to a procedure used in a procedure view or derived table.
If the option (order) clause is given atthe end of the select, joins  are done left to right.  If a procedure is in the leftmost
position in the from it will be called once for the query, if it is in the second position it will
be called once for every row of the leftmost table that passes selection criteria applicable
to it and so on.


</description>
  </item>
  <item>
    <guid>http://docs.openlinksw.com/virtuoso/GRANT.html</guid>
    <author>virtuoso.docs@openlinksw.com</author>
    <category>GRANT, REVOKE Statement</category>
    <link>http://docs.openlinksw.com/virtuoso/GRANT.html</link>
    <pubDate>Tue, 09 Sep 2008 11:44:52 GMT</pubDate>
    <title>GRANT, REVOKE Statement</title>
    <description>
The GRANT and REVOKE statements are used to define privileges on resources to
users and user groups (roles).  A resource is a table, view or stored procedure.  A grantee
can be PUBLIC, meaning any present or future user accounts or a user name.  Granting
a privilege to a user name means that this user AND any users which have this user as their
user group have the privilege.



Only a granted privilege can be revoked. The sequence:



Is invalid because the privilege being revoked was not granted, instead
it was implied by the select on all column to public.


To provide further consistent security to remote data, only the DBA
  group is permitted to use the rexecute(), unless
  explicitly granted.  Caution is required here since any user granted use of
  rexecute() has full control of the remote data source
  set-up by the DBA, however limited to the overall abilities of the remote
  user on the remote data source.

Security of UDTs is maintained through normal SQL GRANT and REVOKE
  statements via a simple extension.  You can define the level of access to both native
  and externally hosted UDTs.  Grants for persistent user defined types
  are persisted into the SYS_GRANTS table.  Grants on temporary user defined
  types are in-memory only and are lost (together with the temporary user defined
  type definition) when the server is restarted.

</description>
  </item>
  <item>
    <guid>http://docs.openlinksw.com/virtuoso/SETstmt.html</guid>
    <author>virtuoso.docs@openlinksw.com</author>
    <category>SET Statement</category>
    <link>http://docs.openlinksw.com/virtuoso/SETstmt.html</link>
    <pubDate>Tue, 09 Sep 2008 11:44:52 GMT</pubDate>
    <title>SET Statement</title>
    <description />
  </item>
  <item>
    <guid>http://docs.openlinksw.com/virtuoso/besteffortunion.html</guid>
    <author>virtuoso.docs@openlinksw.com</author>
    <category>Best Effort Union</category>
    <link>http://docs.openlinksw.com/virtuoso/besteffortunion.html</link>
    <pubDate>Tue, 09 Sep 2008 11:44:52 GMT</pubDate>
    <title>Best Effort Union</title>
    <description>
Virtuoso offers a SQL extension for an error tolerant UNION operation.
The idea is that when querying multiple remote data sources in a single union
construct some of the participating data sources may be allowed to fail while
still returning a result for the successfully queried data sources.



The construct is introduced by the BEST keyword before UNION or UNION ALL. If a
query expression of multiple unions has a single BEST keyword the entire union chain
is considered as a best effort union.  It is however recommended to have the BEST
keyword in FROM of all the UNION keywords.



When a run time error occurs during the evaluation of a term in a best effort union
the evaluation of the term is interrupted and the union continues with the next term.
The partial result set that may have been generated by the failed term is considered
when making the result.


</description>
  </item>
  <item>
    <guid>http://docs.openlinksw.com/virtuoso/aggregates.html</guid>
    <author>virtuoso.docs@openlinksw.com</author>
    <category>Standard and User-Defined Aggregate Functions</category>
    <link>http://docs.openlinksw.com/virtuoso/aggregates.html</link>
    <pubDate>Tue, 09 Sep 2008 11:44:52 GMT</pubDate>
    <title>Standard and User-Defined Aggregate Functions</title>
    <description>In addition to whole set of standard SQL aggregate functions,
Virtuoso provides a method to create application-specific aggregate
functions to create complex data structures inside SQL queries.


The most evident way to calculate some value that depend on number of rows of a table is to
write a stored procedure that opens a cursor, then fetches row after row in a loop and
repeatedly modifies some intermediate values (&quot;accumulators&quot;) inside the loop.
When the fetch operation signals that there are no more data, a final result is calculated
from values of &quot;accumulators&quot;


E.g. to find an average of all values in a table&#39;s column COL, one may open a cursor to fetch
values from the COL, then set two &quot;accumulators&quot; TOTAL and CNT  to zero, then
fetch row after row adding 1 to CNT and adding current value of COL to TOTAL.
At the end of loop, an error should be signalled if CNT is zero, otherwise the result is
TOTAL divided by CNT.

</description>
  </item>
  <item>
    <guid>http://docs.openlinksw.com/virtuoso/sqloptimizer.html</guid>
    <author>virtuoso.docs@openlinksw.com</author>
    <category>Virtuoso SQL Optimization</category>
    <link>http://docs.openlinksw.com/virtuoso/sqloptimizer.html</link>
    <pubDate>Tue, 09 Sep 2008 11:44:52 GMT</pubDate>
    <title>Virtuoso SQL Optimization</title>
    <description>Virtuoso provides a cost based SQL optimizer which performs the following
  types of query transformation:

Virtuoso evaluates various permutations of joined tables against its
  cost model and determines the best fit, from which it generates a query graph.
  This query graph can be returned as a result set by the
  explain() SQL function.
  The cost model is based on table row counts, defined indices and uniqueness
  constraints, and column cardinalities, i.e. counts of distinct values in
  columns.  Additionally, histograms can be made for value distribution of
  individual columns.



Virtuoso automatically maintains statistics about tables in the local
database.  When tables are attached from known types of remote DBMS&#39;s,
Virtuoso also attempts to retrieve statistics information if
available.

The sys_stat_analyze or sys_db_stat stored procedures can be used to force an update of statistics, also recompiling all SQL statements or procedures depending on these statistics.  Once this is done, this overrides the automatic statistics.  The values of automatic statistics can be seen in the SYS_COL_AUTO_STAT table.


</description>
  </item>
  <item>
    <guid>http://docs.openlinksw.com/virtuoso/sqlinverse.html</guid>
    <author>virtuoso.docs@openlinksw.com</author>
    <category>SQL Inverse Functions</category>
    <link>http://docs.openlinksw.com/virtuoso/sqlinverse.html</link>
    <pubDate>Tue, 09 Sep 2008 11:44:52 GMT</pubDate>
    <title>SQL Inverse Functions</title>
    <description>Many virtual database application scenarios require performing various
    conversions on data in legacy tables.  An example of this is currency conversions,
    conversions between British and metric units, replacing complex composite keys with single numeric row id&#39;s and so forth.

SQL views are the normal way of implementing such conversions.  However,
    when making queries with selection criteria referencing the results of these
    conversions we often need to first convert and then test, possibly having to
    bring data from the source system to the virtual database.  Further, we
    will not be able to use indices that may exist on the legacy system if
    we first have to convert and only then test the value of a column.

Virtuoso introduces an SQL extension for dealing with these issues.
    Virtuoso allows the definition of two SQL functions that are inverses of each other,
    for example dollar_to_euro and euro_to_dollar would be examples of inverse functions.

</description>
  </item>
  <item>
    <guid>http://docs.openlinksw.com/virtuoso/GRAMMAR.html</guid>
    <author>virtuoso.docs@openlinksw.com</author>
    <category>SQL Grammar</category>
    <link>http://docs.openlinksw.com/virtuoso/GRAMMAR.html</link>
    <pubDate>Tue, 09 Sep 2008 11:44:52 GMT</pubDate>
    <title>SQL Grammar</title>
    <description />
  </item>
  <item>
    <guid>http://docs.openlinksw.com/virtuoso/BITMAPINDICES.html</guid>
    <author>virtuoso.docs@openlinksw.com</author>
    <category>Bitmap Indices</category>
    <link>http://docs.openlinksw.com/virtuoso/BITMAPINDICES.html</link>
    <pubDate>Tue, 09 Sep 2008 11:44:52 GMT</pubDate>
    <title>Bitmap Indices</title>
    <description>
A bitmap index is a special type of index that is tailored for being efficient for key columns with relatively
few distinct values, i.e. low cardinality key columns. A bitmap index is created with the normal create index
statement by putting the bitmap keyword in front of index, as follows:



Bitmap indices offer space savings of up to 1000 x in some cases and specially for large tables the savings in I/O can be very significant.



A bitmap index can only be used on tables with an integer primary key or in other situations where the last effective key part of the
index is an integer. This is understandable since a bitmap index uses a bitmap for representing the values of the last key part,
thus having one bitmap for each distinct combination of leading key parts. In the above example, the customer table has an
integer c_id column as primary key and a character for the customer&#39;s gender and a 2 character field for the state where
the customer is located. Thus, to count all the male customers in Massachusetts, one will take the males bitmap and
the MA bitmap and perform a bitwise AND of the two. This will have a 1 bit corresponding to the c_id of each
male customer in Massachusetts.


</description>
  </item>
  <item>
    <guid>http://docs.openlinksw.com/virtuoso/urlrewriting.html</guid>
    <author>virtuoso.docs@openlinksw.com</author>
    <category>URL rewriting</category>
    <link>http://docs.openlinksw.com/virtuoso/urlrewriting.html</link>
    <pubDate>Tue, 09 Sep 2008 11:44:52 GMT</pubDate>
    <title>URL rewriting</title>
    <description>URL rewriting is the act of modifying a source URL prior to the final processing of that URL by a
Web Server.

The ability to rewrite URLs may be desirable for many reasons that include:

</description>
  </item>
 </channel>
</rss>
