Author: shawkins
Date: 2010-11-23 16:23:39 -0500 (Tue, 23 Nov 2010)
New Revision: 2739
Added:
trunk/documentation/reference/src/main/docbook/en-US/content/updatable_views.xml
Modified:
trunk/build/kits/jboss-container/teiid-releasenotes.html
trunk/documentation/reference/src/main/docbook/en-US/Reference.xml
Log:
TEIID-1349 adding docs for updatable views
Modified: trunk/build/kits/jboss-container/teiid-releasenotes.html
===================================================================
--- trunk/build/kits/jboss-container/teiid-releasenotes.html 2010-11-23 20:30:27 UTC (rev
2738)
+++ trunk/build/kits/jboss-container/teiid-releasenotes.html 2010-11-23 21:23:39 UTC (rev
2739)
@@ -27,6 +27,7 @@
<H2><A NAME="Highlights"></A>Highlights</H2>
<UL>
<LI><B>Subquery Optimization</B> - added rewrite to INNER JOIN for
applicable WHERE clause subqueries. Also added cost based SEMI and ANTI-SEMI join handling
for applicable non-pushed WHERE and HAVING subqueries.
+ <LI><B>Updatable Views</B> - added support to perform simple
pass-through and more complicated updates through views by default.
</UL>
<h2><a name="Compatibility">Compatibility
Issues</a></h2>
Modified: trunk/documentation/reference/src/main/docbook/en-US/Reference.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/Reference.xml 2010-11-23 20:30:27
UTC (rev 2738)
+++ trunk/documentation/reference/src/main/docbook/en-US/Reference.xml 2010-11-23 21:23:39
UTC (rev 2739)
@@ -51,6 +51,7 @@
<xi:include href="content/xml_queries.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="content/datatypes.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="content/scalar_functions.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="content/updatable_views.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="content/procedures.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="content/transaction_support.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="content/dataroles.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
Added: trunk/documentation/reference/src/main/docbook/en-US/content/updatable_views.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/updatable_views.xml
(rev 0)
+++
trunk/documentation/reference/src/main/docbook/en-US/content/updatable_views.xml 2010-11-23
21:23:39 UTC (rev 2739)
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % CustomDTD SYSTEM "../../../../../../docbook/custom.dtd">
+%CustomDTD;
+]>
+<chapter id="updatable_views">
+ <title>Updatable Views</title>
+
+ <para>Any view may be marked as updatable. In many circumstances the view
definition may allow the view to be inherently
+ updatable without the need to manually define handing of INSERT/UPDATE/DELETE
operations.</para>
+
+ <para>An inherently updatable view cannot be defined with a query that
has:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>A set operation (INTERSECT, EXCEPT, UNION, UNION ALL)</para>
+ </listitem>
+ <listitem>
+ <para>SELECT DISTINCT</para>
+ </listitem>
+ <listitem>
+ <para>Aggregation (aggregate functions, GROUP BY, HAVING)</para>
+ </listitem>
+ <listitem>
+ <para>A LIMIT clause</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Any view column that is not mapped directly to a column is not updatable and
cannot be targeted by an UPDATE set
+ clause or be an INSERT column.</para>
+
+ <para>If a view is defined by a join query or has a WITH clause it may still be
inherently updatable. However in these situations there
+ are further restrictions and the resulting query plan may execute multiple statements.
+ For a non-simple query to be updatable, it is required:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>An INSERT/UPDATE can only modify a single <xref
linkend="key_preserved_table"/>.</para>
+ </listitem>
+ <listitem>
+ <para>To allow DELETE operations there must be only a single <xref
linkend="key_preserved_table"/>.</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>If the default handling is not available or you wish to have an alternative
implementation of an INSERT/UPDATE/DELETE,
+ then you may use <xref linkend="update_procedures"/> to define
procedures to handle the respective operations.</para>
+
+ <section id="key_preserved_table">
+ <title>Key-preserved Table</title>
+
+ <para>A key-preserved table has a primary or unique key that would remain unique
if it were projected into the result of the query.
+ Note that it is not actually required for a view to reference the key columns in the
SELECT clause.
+ The query engine can detect a key preserved table by analyzing the join structure -
which is currently required to be in ANSI join form.
+ The engine will ensure that a join of a key-preserved table must be against one of its
foreign keys.</para>
+ </section>
+
+</chapter>
\ No newline at end of file
Property changes on:
trunk/documentation/reference/src/main/docbook/en-US/content/updatable_views.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain