Author: paul
Date: 2007-03-23 19:12:08 +0100 (Fri, 23 Mar 2007)
New Revision: 5535
Log:
r22159@polar: paul | 2007-03-23 13:11:39 -0500
Split out index hints stuff into separate section.
(Preparation for expanding the section re: WL#3527)
Modified:
trunk/refman-4.1/sql-syntax.xml
trunk/refman-5.0/sql-syntax.xml
trunk/refman-5.1/sql-syntax.xml
Property changes on: trunk
___________________________________________________________________
Name: svk:merge
- 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:22155
7d8d2c4e-af1d-0410-ab9f-b038ce55645b:/mysqldoc-local/mysqldoc:18127
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:14218
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:14593
+ 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:22159
7d8d2c4e-af1d-0410-ab9f-b038ce55645b:/mysqldoc-local/mysqldoc:18127
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:14218
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:14593
Modified: trunk/refman-4.1/sql-syntax.xml
===================================================================
--- trunk/refman-4.1/sql-syntax.xml 2007-03-23 17:57:36 UTC (rev 5534)
+++ trunk/refman-4.1/sql-syntax.xml 2007-03-23 18:12:08 UTC (rev 5535)
Changed blocks: 3, Lines Added: 13, Lines Deleted: 1; 1216 bytes
@@ -6576,7 +6576,7 @@
The use of <literal>USE INDEX</literal>, <literal>IGNORE
INDEX</literal>, <literal>FORCE INDEX</literal> to give the
optimizer hints about how to choose indexes is described in
- <xref linkend="join"/>.
+ <xref linkend="index-hints"/>.
</para>
<para>
@@ -7406,6 +7406,12 @@
<replaceable>index_name</replaceable> [, <replaceable>index_name</replaceable>] ...
</programlisting>
+ <para>
+ Index hints can be specified to affect how the MySQL optimizer
+ makes use of indexes. For more information, see
+ <xref linkend="index-hints"/>.
+ </para>
+
<remark role="help-description-end"/>
<para>
@@ -7573,6 +7579,12 @@
</itemizedlist>
+ </section>
+
+ <section id="index-hints">
+
+ <title>Index Hint Syntax</title>
+
<indexterm>
<primary>index hints</primary>
</indexterm>
Modified: trunk/refman-5.0/sql-syntax.xml
===================================================================
--- trunk/refman-5.0/sql-syntax.xml 2007-03-23 17:57:36 UTC (rev 5534)
+++ trunk/refman-5.0/sql-syntax.xml 2007-03-23 18:12:08 UTC (rev 5535)
Changed blocks: 4, Lines Added: 105, Lines Deleted: 93; 7554 bytes
@@ -6627,7 +6627,7 @@
The use of <literal>USE INDEX</literal>, <literal>IGNORE
INDEX</literal>, <literal>FORCE INDEX</literal> to give the
optimizer hints about how to choose indexes is described in
- <xref linkend="join"/>.
+ <xref linkend="index-hints"/>.
</para>
<para>
@@ -7547,6 +7547,12 @@
described later in this section.
</para>
+ <para>
+ Index hints can be specified to affect how the MySQL optimizer
+ makes use of indexes. For more information, see
+ <xref linkend="index-hints"/>.
+ </para>
+
<remark role="help-description-end"/>
<para>
@@ -7722,99 +7728,7 @@
LEFT JOIN table3 ON table2.id=table3.id;
</programlisting>
- <indexterm>
- <primary>index hints</primary>
- </indexterm>
-
- <indexterm>
- <primary>hints</primary>
- <secondary>index</secondary>
- </indexterm>
-
- <indexterm>
- <primary>USE INDEX</primary>
- </indexterm>
-
- <indexterm>
- <primary>IGNORE INDEX</primary>
- </indexterm>
-
- <indexterm>
- <primary>FORCE INDEX</primary>
- </indexterm>
-
<para>
- You can provide hints as to which index MySQL should use when
- retrieving information from a table. By specifying
- <literal>USE INDEX
- (<replaceable>index_list</replaceable>)</literal>, you can
- tell MySQL to use only one of the possible indexes to find
- rows in the table. The alternative syntax <literal>IGNORE
- INDEX (<replaceable>index_list</replaceable>)</literal> can be
- used to tell MySQL to not use some particular index. These
- hints are useful if <literal>EXPLAIN</literal> shows that
- MySQL is using the wrong index from the list of possible
- indexes.
- </para>
-
- <para>
- You can also use <literal>FORCE INDEX</literal>, which acts
- like <literal>USE INDEX
- (<replaceable>index_list</replaceable>)</literal> but with the
- addition that a table scan is assumed to be
- <emphasis>very</emphasis> expensive. In other words, a table
- scan is used only if there is no way to use one of the given
- indexes to find rows in the table.
- </para>
-
- <para>
- <literal>USE INDEX</literal>, <literal>IGNORE INDEX</literal>,
- and <literal>FORCE INDEX</literal> affect only which indexes
- are used when MySQL decides how to find rows in the table and
- how to do the join. They do not affect whether an index is
- used when resolving an <literal>ORDER BY</literal> or
- <literal>GROUP BY</literal>.
- </para>
-
- <para>
- These hints require the names of <emphasis>indexes</emphasis>,
- not the names of columns. The name of a <literal>PRIMARY
- KEY</literal> is <literal>PRIMARY.</literal> Use <literal>SHOW
- INDEX</literal> to see the index names for a table.
- </para>
-
- <indexterm>
- <primary>USE KEY</primary>
- </indexterm>
-
- <indexterm>
- <primary>IGNORE KEY</primary>
- </indexterm>
-
- <indexterm>
- <primary>FORCE KEY</primary>
- </indexterm>
-
- <para>
- <literal>USE KEY</literal>, <literal>IGNORE KEY</literal>, and
- <literal>FORCE KEY</literal> are synonyms for <literal>USE
- INDEX</literal>, <literal>IGNORE INDEX</literal>, and
- <literal>FORCE INDEX</literal>.
- </para>
-
- <para>
- Examples:
- </para>
-
-<programlisting>
-SELECT * FROM table1 USE INDEX (key1,key2)
- WHERE key1=1 AND key2=2 AND key3=3;
-
-SELECT * FROM table1 IGNORE INDEX (key3)
- WHERE key1=1 AND key2=2 AND key3=3;
-</programlisting>
-
- <para>
<emphasis role="bold">Join Processing Changes in MySQL
5.0.12</emphasis>
</para>
@@ -8369,6 +8283,104 @@
</section>
+ <section id="index-hints">
+
+ <title>Index Hint Syntax</title>
+
+ <indexterm>
+ <primary>index hints</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>hints</primary>
+ <secondary>index</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>USE INDEX</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>IGNORE INDEX</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>FORCE INDEX</primary>
+ </indexterm>
+
+ <para>
+ You can provide hints as to which index MySQL should use when
+ retrieving information from a table. By specifying
+ <literal>USE INDEX
+ (<replaceable>index_list</replaceable>)</literal>, you can
+ tell MySQL to use only one of the possible indexes to find
+ rows in the table. The alternative syntax <literal>IGNORE
+ INDEX (<replaceable>index_list</replaceable>)</literal> can be
+ used to tell MySQL to not use some particular index. These
+ hints are useful if <literal>EXPLAIN</literal> shows that
+ MySQL is using the wrong index from the list of possible
+ indexes.
+ </para>
+
+ <para>
+ You can also use <literal>FORCE INDEX</literal>, which acts
+ like <literal>USE INDEX
+ (<replaceable>index_list</replaceable>)</literal> but with the
+ addition that a table scan is assumed to be
+ <emphasis>very</emphasis> expensive. In other words, a table
+ scan is used only if there is no way to use one of the given
+ indexes to find rows in the table.
+ </para>
+
+ <para>
+ <literal>USE INDEX</literal>, <literal>IGNORE INDEX</literal>,
+ and <literal>FORCE INDEX</literal> affect only which indexes
+ are used when MySQL decides how to find rows in the table and
+ how to do the join. They do not affect whether an index is
+ used when resolving an <literal>ORDER BY</literal> or
+ <literal>GROUP BY</literal>.
+ </para>
+
+ <para>
+ These hints require the names of <emphasis>indexes</emphasis>,
+ not the names of columns. The name of a <literal>PRIMARY
+ KEY</literal> is <literal>PRIMARY.</literal> Use <literal>SHOW
+ INDEX</literal> to see the index names for a table.
+ </para>
+
+ <indexterm>
+ <primary>USE KEY</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>IGNORE KEY</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>FORCE KEY</primary>
+ </indexterm>
+
+ <para>
+ <literal>USE KEY</literal>, <literal>IGNORE KEY</literal>, and
+ <literal>FORCE KEY</literal> are synonyms for <literal>USE
+ INDEX</literal>, <literal>IGNORE INDEX</literal>, and
+ <literal>FORCE INDEX</literal>.
+ </para>
+
+ <para>
+ Examples:
+ </para>
+
+<programlisting>
+SELECT * FROM table1 USE INDEX (key1,key2)
+ WHERE key1=1 AND key2=2 AND key3=3;
+
+SELECT * FROM table1 IGNORE INDEX (key3)
+ WHERE key1=1 AND key2=2 AND key3=3;
+</programlisting>
+
+ </section>
+
<section id="union">
<title><literal>UNION</literal> Syntax</title>
Modified: trunk/refman-5.1/sql-syntax.xml
===================================================================
--- trunk/refman-5.1/sql-syntax.xml 2007-03-23 17:57:36 UTC (rev 5534)
+++ trunk/refman-5.1/sql-syntax.xml 2007-03-23 18:12:08 UTC (rev 5535)
Changed blocks: 4, Lines Added: 105, Lines Deleted: 93; 7573 bytes
@@ -8295,7 +8295,7 @@
The use of <literal>USE INDEX</literal>, <literal>IGNORE
INDEX</literal>, <literal>FORCE INDEX</literal> to give the
optimizer hints about how to choose indexes is described in
- <xref linkend="join"/>.
+ <xref linkend="index-hints"/>.
</para>
<para>
@@ -9190,6 +9190,12 @@
nested joins (see <xref linkend="nested-joins"/>).
</para>
+ <para>
+ Index hints can be specified to affect how the MySQL optimizer
+ makes use of indexes. For more information, see
+ <xref linkend="index-hints"/>.
+ </para>
+
<remark role="help-description-end"/>
<para>
@@ -9365,99 +9371,7 @@
LEFT JOIN table3 ON table2.id=table3.id;
</programlisting>
- <indexterm>
- <primary>index hints</primary>
- </indexterm>
-
- <indexterm>
- <primary>hints</primary>
- <secondary>index</secondary>
- </indexterm>
-
- <indexterm>
- <primary>USE INDEX</primary>
- </indexterm>
-
- <indexterm>
- <primary>IGNORE INDEX</primary>
- </indexterm>
-
- <indexterm>
- <primary>FORCE INDEX</primary>
- </indexterm>
-
<para>
- You can provide hints as to which index MySQL should use when
- retrieving information from a table. By specifying
- <literal>USE INDEX
- (<replaceable>index_list</replaceable>)</literal>, you can
- tell MySQL to use only one of the possible indexes to find
- rows in the table. The alternative syntax <literal>IGNORE
- INDEX (<replaceable>index_list</replaceable>)</literal> can be
- used to tell MySQL to not use some particular index. These
- hints are useful if <literal>EXPLAIN</literal> shows that
- MySQL is using the wrong index from the list of possible
- indexes.
- </para>
-
- <para>
- You can also use <literal>FORCE INDEX</literal>, which acts
- like <literal>USE INDEX
- (<replaceable>index_list</replaceable>)</literal> but with the
- addition that a table scan is assumed to be
- <emphasis>very</emphasis> expensive. In other words, a table
- scan is used only if there is no way to use one of the given
- indexes to find rows in the table.
- </para>
-
- <para>
- <literal>USE INDEX</literal>, <literal>IGNORE INDEX</literal>,
- and <literal>FORCE INDEX</literal> affect only which indexes
- are used when MySQL decides how to find rows in the table and
- how to do the join. They do not affect whether an index is
- used when resolving an <literal>ORDER BY</literal> or
- <literal>GROUP BY</literal>.
- </para>
-
- <para>
- These hints require the names of <emphasis>indexes</emphasis>,
- not the names of columns. The name of a <literal>PRIMARY
- KEY</literal> is <literal>PRIMARY.</literal> Use <literal>SHOW
- INDEX</literal> to see the index names for a table.
- </para>
-
- <indexterm>
- <primary>USE KEY</primary>
- </indexterm>
-
- <indexterm>
- <primary>IGNORE KEY</primary>
- </indexterm>
-
- <indexterm>
- <primary>FORCE KEY</primary>
- </indexterm>
-
- <para>
- <literal>USE KEY</literal>, <literal>IGNORE KEY</literal>, and
- <literal>FORCE KEY</literal> are synonyms for <literal>USE
- INDEX</literal>, <literal>IGNORE INDEX</literal>, and
- <literal>FORCE INDEX</literal>.
- </para>
-
- <para>
- Examples:
- </para>
-
-<programlisting>
-SELECT * FROM table1 USE INDEX (key1,key2)
- WHERE key1=1 AND key2=2 AND key3=3;
-
-SELECT * FROM table1 IGNORE INDEX (key3)
- WHERE key1=1 AND key2=2 AND key3=3;
-</programlisting>
-
- <para>
<emphasis role="bold">Join Processing Changes in MySQL
5.0.12</emphasis>
</para>
@@ -10012,6 +9926,104 @@
</section>
+ <section id="index-hints">
+
+ <title>Index Hint Syntax</title>
+
+ <indexterm>
+ <primary>index hints</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>hints</primary>
+ <secondary>index</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>USE INDEX</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>IGNORE INDEX</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>FORCE INDEX</primary>
+ </indexterm>
+
+ <para>
+ You can provide hints as to which index MySQL should use when
+ retrieving information from a table. By specifying
+ <literal>USE INDEX
+ (<replaceable>index_list</replaceable>)</literal>, you can
+ tell MySQL to use only one of the possible indexes to find
+ rows in the table. The alternative syntax <literal>IGNORE
+ INDEX (<replaceable>index_list</replaceable>)</literal> can be
+ used to tell MySQL to not use some particular index. These
+ hints are useful if <literal>EXPLAIN</literal> shows that
+ MySQL is using the wrong index from the list of possible
+ indexes.
+ </para>
+
+ <para>
+ You can also use <literal>FORCE INDEX</literal>, which acts
+ like <literal>USE INDEX
+ (<replaceable>index_list</replaceable>)</literal> but with the
+ addition that a table scan is assumed to be
+ <emphasis>very</emphasis> expensive. In other words, a table
+ scan is used only if there is no way to use one of the given
+ indexes to find rows in the table.
+ </para>
+
+ <para>
+ <literal>USE INDEX</literal>, <literal>IGNORE INDEX</literal>,
+ and <literal>FORCE INDEX</literal> affect only which indexes
+ are used when MySQL decides how to find rows in the table and
+ how to do the join. They do not affect whether an index is
+ used when resolving an <literal>ORDER BY</literal> or
+ <literal>GROUP BY</literal>.
+ </para>
+
+ <para>
+ These hints require the names of <emphasis>indexes</emphasis>,
+ not the names of columns. The name of a <literal>PRIMARY
+ KEY</literal> is <literal>PRIMARY.</literal> Use <literal>SHOW
+ INDEX</literal> to see the index names for a table.
+ </para>
+
+ <indexterm>
+ <primary>USE KEY</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>IGNORE KEY</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>FORCE KEY</primary>
+ </indexterm>
+
+ <para>
+ <literal>USE KEY</literal>, <literal>IGNORE KEY</literal>, and
+ <literal>FORCE KEY</literal> are synonyms for <literal>USE
+ INDEX</literal>, <literal>IGNORE INDEX</literal>, and
+ <literal>FORCE INDEX</literal>.
+ </para>
+
+ <para>
+ Examples:
+ </para>
+
+<programlisting>
+SELECT * FROM table1 USE INDEX (key1,key2)
+ WHERE key1=1 AND key2=2 AND key3=3;
+
+SELECT * FROM table1 IGNORE INDEX (key3)
+ WHERE key1=1 AND key2=2 AND key3=3;
+</programlisting>
+
+ </section>
+
<section id="union">
<title><literal>UNION</literal> Syntax</title>
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r5535 - in trunk: . refman-4.1 refman-5.0 refman-5.1 | paul | 23 Mar |