You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by jt...@apache.org on 2006/08/21 19:35:03 UTC

svn commit: r433298 - in /db/derby/docs/trunk/src/tuning: ctundepth1002853.dita ctunperf98197.dita

Author: jta
Date: Mon Aug 21 10:35:02 2006
New Revision: 433298

URL: http://svn.apache.org/viewvc?rev=433298&view=rev
Log:
DERBY-1655 (partial): Add documentation for XML functionality to the Tuning
Guide.

Committed patch derby1655_tuning.diff by Laura Stewart <sc...@gmail.com>.

Modified:
    db/derby/docs/trunk/src/tuning/ctundepth1002853.dita
    db/derby/docs/trunk/src/tuning/ctunperf98197.dita

Modified: db/derby/docs/trunk/src/tuning/ctundepth1002853.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/tuning/ctundepth1002853.dita?rev=433298&r1=433297&r2=433298&view=diff
==============================================================================
--- db/derby/docs/trunk/src/tuning/ctundepth1002853.dita (original)
+++ db/derby/docs/trunk/src/tuning/ctundepth1002853.dita Mon Aug 21 10:35:02 2006
@@ -1,4 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
+ 
+<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
+ "../dtd/concept.dtd">
 <!-- 
 Licensed to the Apache Software Foundation (ASF) under one or more
 contributor license agreements.  See the NOTICE file distributed with
@@ -15,18 +18,19 @@
 See the License for the specific language governing permissions and  
 limitations under the License.
 -->
-
-<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
- "../dtd/concept.dtd">
 <concept id="ctundepth1002853" xml:lang="en-us">
 <title>Create useful indexes</title>
-<prolog></prolog>
+<shortdesc>Indexes are useful when a query contains a WHERE clause.</shortdesc>
+<prolog><metadata>
+<keywords><indexterm>indexes<indexterm>guidance, creating</indexterm></indexterm>
+</keywords>
+</metadata></prolog>
 <conbody>
-<p>Indexes are useful when a query contains a WHERE clause. Without a WHERE
-clause, <ph conref="tunconrefs.dita#prod/productshortname"></ph> is <i>supposed</i> to return all the data in the table, and
-so a table scan is the correct (if not desirable) behavior. (More about that
-in <xref href="ctundepth36205.dita#ctundepth36205"></xref>.)</p>
-<p><ph conref="tunconrefs.dita#prod/productshortname"></ph> creates indexes on tables in the following situations:   <ul>
+<p>Without a WHERE clause, <ph conref="tunconrefs.dita#prod/productshortname"></ph> is <i>supposed</i> to
+return all the data in the table, and so a table scan is the correct (if not
+desirable) behavior. (More about that in <xref href="ctundepth36205.dita#ctundepth36205"></xref>.)</p>
+<p><ph conref="tunconrefs.dita#prod/productshortname"></ph> creates indexes
+on tables in the following situations:   <ul>
 <li>When you define a primary key, unique, or foreign key constraint on a
 table. See "CONSTRAINT clause" in the <cite><ph conref="tunconrefs.dita#pub/citref"></ph></cite> for
 more information.</li>
@@ -34,15 +38,15 @@
 </ul></p>
 <p>For an index to be useful for a particular statement, one of the columns
 in the statement's WHERE clause must be the first column in the index's key.
-  <note>For a complete discussion of how indexes work and when they are useful, see <xref href="ctunoptimz33368.dita#ctunoptimz33368"></xref> and <xref
-href="ctunoptimz30217.dita#ctunoptimz30217"></xref>.</note></p>
+  <note>For a complete discussion of how indexes work and when they are useful,
+see <xref href="ctunoptimz33368.dita#ctunoptimz33368"></xref> and <xref href="ctunoptimz30217.dita#ctunoptimz30217"></xref>.</note></p>
 <p>Indexes provide some other benefits as well:   <ul>
-<li>If all the data requested are in the index, <ph conref="tunconrefs.dita#prod/productshortname"></ph> does not have to go
-to the table at all. (See <xref href="ctunoptimz30768.dita#ctunoptimz30768"></xref>.)</li>
-<li>For operations that require a sort (ORDER BY), if <ph conref="tunconrefs.dita#prod/productshortname"></ph> uses the index
-to retrieve the data, it does not have to perform a separate sorting step
-for some of these operations in some situations. (See <xref href="ctunoptimz27036.dita#ctunoptimz27036"></xref>.)</li>
-</ul> <note><ph conref="tunconrefs.dita#prod/productshortname"></ph> does not support indexing long columns like CLOB and BLOB.</note></p>
+<li>If all the data requested are in the index, <ph conref="tunconrefs.dita#prod/productshortname"></ph> does
+not have to go to the table at all. (See <xref href="ctunoptimz30768.dita#ctunoptimz30768"></xref>.)</li>
+<li>For operations that require a sort (ORDER BY), if <ph conref="tunconrefs.dita#prod/productshortname"></ph> uses
+the index to retrieve the data, it does not have to perform a separate sorting
+step for some of these operations in some situations. (See <xref href="ctunoptimz27036.dita#ctunoptimz27036"></xref>.)</li>
+</ul> <note><ph conref="tunconrefs.dita#prod/productshortname"></ph> does
+not support indexing on columns with data types like BLOB, CLOB, and XML.</note></p>
 </conbody>
 </concept>
-

Modified: db/derby/docs/trunk/src/tuning/ctunperf98197.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/tuning/ctunperf98197.dita?rev=433298&r1=433297&r2=433298&view=diff
==============================================================================
--- db/derby/docs/trunk/src/tuning/ctunperf98197.dita (original)
+++ db/derby/docs/trunk/src/tuning/ctunperf98197.dita Mon Aug 21 10:35:02 2006
@@ -1,4 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
+ 
+<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
+ "../dtd/concept.dtd">
 <!-- 
 Licensed to the Apache Software Foundation (ASF) under one or more
 contributor license agreements.  See the NOTICE file distributed with
@@ -15,110 +18,138 @@
 See the License for the specific language governing permissions and  
 limitations under the License.
 -->
-<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "../dtd/concept.dtd">
-<concept xml:lang="en-us" id="ctunperf98197">
+<concept id="ctunperf98197" xml:lang="en-us">
 <title>Use the appropriate getXXX and setXXX methods for the type</title>
+<shortdesc>For performance reasons, use the recommended <i>getXXX</i> method
+when retrieving values, and use the recommended <i>setXXX</i> method when
+setting values for parameters.</shortdesc>
 <prolog><metadata>
-<keywords>
+<keywords><indexterm>methods<indexterm>getxxx</indexterm></indexterm><indexterm>methods<indexterm>setxxx</indexterm></indexterm>
 </keywords>
-</metadata>
-</prolog>
+</metadata></prolog>
 <conbody>
-<p>JDBC is permissive. It lets you use <i>java.sql.ResultSet.getFloat</i> to retrieve an int, <i>java.sql.ResultSet.getObject</i> to retrieve any type, and so on.  (<i>java.sql.ResultSet </i>and <i>java.sql.CallableStatement</i> provide <i>getXXX</i> methods, and <i>java .sql.PreparedStatement</i> and <i>java.sql.CallableStatement</i> provide <i>setXXX</i> methods.) This permissiveness is convenient but expensive in terms
-of performance.</p>
-<p>For performance reasons, use the recommended <i>getXXX</i> method when retrieving values, and use the recommended <i>setXXX</i> method when setting values for parameters.</p>
-<p><xref href="ctunperf98197.dita#ctunperf98197/ctunperf31241"/> shows the recommended <i>getXXX</i> methods for given <i>java.sql</i> (JDBC) types,
-and their corresponding SQL types.  
-<table id="ctunperf31241" frame="all">
+<p>JDBC is permissive. It lets you use <i>java.sql.ResultSet.getFloat</i> to
+retrieve an int, <i>java.sql.ResultSet.getObject</i> to retrieve any type,
+and so on.  (<i>java.sql.ResultSet </i>and <i>java.sql.CallableStatement</i> provide <i>getXXX</i> methods,
+and <i>java .sql.PreparedStatement</i> and <i>java.sql.CallableStatement</i> provide <i>setXXX</i> methods.)
+This permissiveness is convenient but expensive in terms of performance.</p>
+<p>The following table shows the recommended <i>getXXX</i> methods for given <i>java.sql</i> (JDBC)
+types, and their corresponding SQL types.   <table frame="all" id="ctunperf31241">
 <title>Mapping of java.sql.Types to SQL types</title>
-<tgroup cols="3" colsep="1" rowsep="1">
-<colspec colnum="1" colname="1" colwidth="36*"/>
-<colspec colnum="2" colname="2" colwidth="30*"/>
-<colspec colnum="3" colname="3" colwidth="34*"/>
+<tgroup cols="3" colsep="1" rowsep="1"><colspec colname="1" colnum="1" colwidth="36*"/>
+<colspec colname="2" colnum="2" colwidth="30*"/><colspec colname="3" colnum="3"
+colwidth="34*"/>
 <thead>
 <row>
 <entry colname="1">Recommended <b><i>getXXX</i></b> Method</entry>
 <entry colname="2"><b><i>java.sql.Types</i></b></entry>
-<entry colname="3">SQL types</entry></row>
+<entry colname="3">SQL types</entry>
+</row>
 </thead>
 <tbody>
 <row>
 <entry colname="1"><i>getLong</i></entry>
 <entry colname="2">BIGINT</entry>
-<entry colname="3">BIGINT</entry></row>
+<entry colname="3">BIGINT</entry>
+</row>
 <row>
 <entry colname="1"><i>getBytes</i></entry>
 <entry colname="2">BINARY</entry>
-<entry colname="3">CHAR FOR BIT DATA</entry></row>
+<entry colname="3">CHAR FOR BIT DATA</entry>
+</row>
+<row>
+<entry colname="1"><i>getBlob</i></entry>
+<entry colname="2">BLOB</entry>
+<entry colname="3">BLOB</entry>
+</row>
 <row>
 <entry colname="1"><i>getString</i></entry>
 <entry colname="2">CHAR</entry>
-<entry colname="3">CHAR</entry></row>
+<entry colname="3">CHAR</entry>
+</row>
+<row>
+<entry colname="1"><i>getClob</i></entry>
+<entry colname="2">CLOB</entry>
+<entry colname="3">CLOB</entry>
+</row>
 <row>
 <entry colname="1"><i>getDate</i></entry>
 <entry colname="2">DATE</entry>
-<entry colname="3">DATE</entry></row>
+<entry colname="3">DATE</entry>
+</row>
 <row>
 <entry colname="1"><i>getBigDecimal</i></entry>
 <entry colname="2">DECIMAL</entry>
-<entry colname="3">DECIMAL</entry></row>
+<entry colname="3">DECIMAL</entry>
+</row>
 <row>
 <entry colname="1"><i>getDouble</i></entry>
 <entry colname="2">DOUBLE</entry>
-<entry colname="3">DOUBLE PRECISION</entry></row>
+<entry colname="3">DOUBLE PRECISION</entry>
+</row>
 <row>
 <entry colname="1"><i>getDouble</i></entry>
 <entry colname="2">FLOAT</entry>
-<entry colname="3">DOUBLE PRECISION</entry></row>
+<entry colname="3">DOUBLE PRECISION</entry>
+</row>
 <row>
 <entry colname="1"><i>getInt</i></entry>
 <entry colname="2">INTEGER</entry>
-<entry colname="3">INTEGER</entry></row>
+<entry colname="3">INTEGER</entry>
+</row>
 <row>
 <entry colname="1"><i>getBinaryStream</i></entry>
 <entry colname="2">LONGVARBINARY</entry>
-<entry colname="3">LONG VARCHAR FOR BIT DATA</entry></row>
+<entry colname="3">LONG VARCHAR FOR BIT DATA</entry>
+</row>
 <row>
 <entry colname="1"><i>getAsciiStream, getUnicodeStream</i></entry>
 <entry colname="2">LONGVARCHAR</entry>
-<entry colname="3">LONG VARCHAR</entry></row>
+<entry colname="3">LONG VARCHAR</entry>
+</row>
 <row>
 <entry colname="1"><i>getBigDecimal</i></entry>
 <entry colname="2">NUMERIC</entry>
-<entry colname="3">DECIMAL</entry></row>
+<entry colname="3">DECIMAL</entry>
+</row>
 <row>
 <entry colname="1"><i>getFloat</i></entry>
 <entry colname="2">REAL</entry>
-<entry colname="3">REAL</entry></row>
+<entry colname="3">REAL</entry>
+</row>
 <row>
 <entry colname="1"><i>getShort</i></entry>
 <entry colname="2">SMALLINT</entry>
-<entry colname="3">SMALLINT</entry></row>
+<entry colname="3">SMALLINT</entry>
+</row>
 <row>
 <entry colname="1"><i>getTime</i></entry>
 <entry colname="2">TIME</entry>
-<entry colname="3">TIME</entry></row>
+<entry colname="3">TIME</entry>
+</row>
 <row>
 <entry colname="1"><i>getTimestamp</i></entry>
 <entry colname="2">TIMESTAMP</entry>
-<entry colname="3">TIMESTAMP</entry></row>
+<entry colname="3">TIMESTAMP</entry>
+</row>
 <row>
 <entry colname="1"><i>getBytes</i></entry>
 <entry colname="2">VARBINARY</entry>
-<entry colname="3">VARCHAR FOR BIT DATA</entry></row>
+<entry colname="3">VARCHAR FOR BIT DATA</entry>
+</row>
 <row>
 <entry colname="1"><i>getString</i></entry>
 <entry colname="2">VARCHAR</entry>
-<entry colname="3">VARCHAR</entry></row>
+<entry colname="3">VARCHAR</entry>
+</row>
 <row>
-<entry colname="1">getBlob</entry>
-<entry colname="2">BLOB</entry>
-<entry colname="3">BLOB</entry></row>
-<row>
-<entry colname="1">getClob</entry>
-<entry colname="2">CLOB</entry>
-<entry colname="3">CLOB</entry></row>
+<entry colname="1">None supported. You must use XMLSERIALIZE and then the
+corresponding getXXX method.</entry>
+<entry colname="2">SQLXML</entry>
+<entry colname="3">XML</entry>
+</row>
 </tbody>
 </tgroup>
 </table></p>
-</conbody></concept>
+</conbody>
+</concept>