You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by db...@apache.org on 2016/09/19 16:51:44 UTC

[1/3] incubator-trafodion git commit: [TRAFODION-2164] Incremental Update Statistics documentation

Repository: incubator-trafodion
Updated Branches:
  refs/heads/master 66827b053 -> b6b9f43b6


[TRAFODION-2164] Incremental Update Statistics documentation


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/36446cea
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/36446cea
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/36446cea

Branch: refs/heads/master
Commit: 36446cead6c0961384bbc402f8f0fcc772d7de4c
Parents: 1cb7a1a
Author: Dave Birdsall <db...@apache.org>
Authored: Thu Sep 15 18:42:28 2016 +0000
Committer: Dave Birdsall <db...@apache.org>
Committed: Thu Sep 15 18:42:28 2016 +0000

----------------------------------------------------------------------
 docs/shared/revisions.txt                       |  1 +
 .../src/asciidoc/_chapters/about.adoc           | 15 +---
 .../src/asciidoc/_chapters/sql_statements.adoc  |  4 +
 .../src/asciidoc/_chapters/sql_utilities.adoc   | 86 +++++++++++++++++++-
 4 files changed, 89 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/36446cea/docs/shared/revisions.txt
----------------------------------------------------------------------
diff --git a/docs/shared/revisions.txt b/docs/shared/revisions.txt
index 6afa98d..f58a61d 100644
--- a/docs/shared/revisions.txt
+++ b/docs/shared/revisions.txt
@@ -26,6 +26,7 @@
 [cols="2",options="header"]
 |===
 | Version    | Date
+| 2.1.0      | TBD
 | 2.0.1      | July 7, 2016
 | 2.0.0      | June 6, 2016
 | 1.3.0      | January, 2016  

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/36446cea/docs/sql_reference/src/asciidoc/_chapters/about.adoc
----------------------------------------------------------------------
diff --git a/docs/sql_reference/src/asciidoc/_chapters/about.adoc b/docs/sql_reference/src/asciidoc/_chapters/about.adoc
index 247e70d..b3b9ef6 100644
--- a/docs/sql_reference/src/asciidoc/_chapters/about.adoc
+++ b/docs/sql_reference/src/asciidoc/_chapters/about.adoc
@@ -51,20 +51,7 @@ This edition includes updates for these new features:
 [cols="50%,50%",options="header"]
 |===
 | New Feature                                           | Location in the Manual
-| On Line Analytical Process (OLAP) window functions    | <<olap_functions,OLAP Functions>>
-| Ability to cancel DDL, update statistics, and
-additional child query operations in addition to
-DML statements                                          | <<control_query_cancel_statement,CONTROL QUERY CANCEL Statement>> 
-| Authorization required to run the CONTROL QUERY
-CANCEL Statement                                        | <<control_query_cancel_statement,CONTROL QUERY CANCEL Statement>>
-| Ability to grant privileges on behalf of a role
-using the GRANTED BY clause.                            | <<grant_component_privilege_statement,GRANT COMPONENT PRIVILEGE Statement>>
-| Authorization required for all SHOWDDL commands       | <<showddl_statement,SHOWDDL Statement>> +
-<<SHOWDDL_SCHEMA_Statement,SHOWDDL SCHEMA Statement>>
-| Ability to display the DDL syntax of a library object
-using the SHOWDDL LIBRARY command                       | <<showddl_statement,SHOWDDL Statement>>
-| Listing of HBase objects using the GET HBASE OBJECTS
-command through an SQL interface                        | <<get_hbase_objects_statement,GET HBASE OBJECTS Statement>>
+| Incremental UPDATE STATISTICS                         | <<update_statistics_statement,UPDATE STATISTICS Statement>>
 |===
 
 <<<

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/36446cea/docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc
----------------------------------------------------------------------
diff --git a/docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc b/docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc
index c0c218b..8e2fbb6 100644
--- a/docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc
+++ b/docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc
@@ -2344,6 +2344,10 @@ creates an HBase table if it does not already exist when the table is created. T
 +
 specifies the ANSI logical name of the table. See <<database_object_names,Database Object Names>>. This name must be
 unique among names of tables and views within its schema.
++
+TIP: Avoid using table names that begin with "TRAF_SAMPLE_", as {project-name} SQL assumes that
+such tables are persistent sample tables. See also <<update_statistics_incremental_update_statistics,
+Incremental Update Statistics>>.
 
 * `SALT USING _num_ PARTITIONS [ON (_column_[, _column_]&#8230;)]`
 +

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/36446cea/docs/sql_reference/src/asciidoc/_chapters/sql_utilities.adoc
----------------------------------------------------------------------
diff --git a/docs/sql_reference/src/asciidoc/_chapters/sql_utilities.adoc b/docs/sql_reference/src/asciidoc/_chapters/sql_utilities.adoc
index d386e64..248f994 100644
--- a/docs/sql_reference/src/asciidoc/_chapters/sql_utilities.adoc
+++ b/docs/sql_reference/src/asciidoc/_chapters/sql_utilities.adoc
@@ -686,11 +686,12 @@ devise optimized access plans.
 UPDATE STATISTICS is a {project-name} SQL extension.
 
 ```
-UPDATE STATISTICS FOR TABLE table [CLEAR | on-clause]
+UPDATE STATISTICS FOR TABLE table [CLEAR | on-clause | sample-table-clause ]
 
 on-clause is:
     ON column-group-list CLEAR
   | ON column-group-list [histogram-option]...
+  | ON column-group-list INCREMENTAL WHERE predicate
 
 column-group-list is:
     column-list [,column-list]...
@@ -716,8 +717,12 @@ histogram-option is:
 
 sample-option is:
     [r ROWS]
-  | RANDOM percent PERCENT
+  | RANDOM percent PERCENT [PERSISTENT]
   | PERIODIC size ROWS EVERY period ROWS
+
+sample-table-clause is:
+    CREATE SAMPLE RANDOM percent PERCENT
+  | REMOVE SAMPLE
 ```
 
 [[update_statistics_syntax]]
@@ -872,7 +877,6 @@ than specified, or if the sample size is greater than the system limit,
 A row sample is used to read _r_ rows from the table. The value _r_ must
 be an integer that is greater than zero 
 
-<<<
 **** `RANDOM _percent_ PERCENT`
 +
 directs {project-name} SQL to choose rows randomly from the table. The value
@@ -881,6 +885,12 @@ addition, only the first four digits to the right of the decimal point
 are significant. For example, value 0.00001 is considered to be 0.0000,
 Value 1.23456 is considered to be 1.2345.
 
+***** `PERSISTENT`
++
+directs {project-name} SQL to create a persistent sample table and store the
+random sample in it. This table can then be used later for updating statistics
+incrementally.
+
 **** `PERIODIC _size_ ROWS EVERY _period_ ROW`
 +
 directs {project-name} SQL to choose the first _size_ number of rows from
@@ -890,6 +900,28 @@ _size_ &#60;= _period_). The size of the _period_ is defined by the number
 of rows specified for _period_. The value _period_ must be an integer
 that is greater than zero (_period_ > 0).
 
+* `INCREMENTAL WHERE _predicate_`
++
+directs {project-name} SQL to update statistics incrementally. That is, instead
+of taking a fresh sample of the entire table, {project-name} SQL will use a previously
+created persistent sample table. {project-name} SQL will update the persistent sample
+by replacing any rows satisfying the _predicate_ with a fresh sample of rows from
+the original table satisfying the _predicate_. The sampling rate used is the
+_percent_ specified when the persistent sample table was created. Statistics
+are then generated from this updated sample. See also
+<<update_statistics_incremental_update_statistics,
+Incremental Update Statistics>>.
+
+* `CREATE SAMPLE RANDOM _percent_ PERCENT`
++
+Creates a persistent sample table associated with this table. The sample is
+created using a random sample of _percent_ percent of the rows. The table
+can then be used for later incremental statistics update.
+
+* `REMOVE SAMPLE`
++
+Drops the persistent sample table associated with this table.
+
 [[update_statistics_considerations]]
 === Considerations for UPDATE STATISTICS
 
@@ -1046,6 +1078,35 @@ NECESSARY COLUMN[S] to generate the needed histograms:
 update statistics for table _table-name_ on necessary columns sample;
 ```
 
+[[update_statistics_incremental_update_statistics]]
+==== Incremental Update Statistics
+
+UPDATE STATISTICS processing time can be lengthy for very large tables.
+One strategy for reducing the time is to create histograms only for
+columns that actually need them (for example, using the ON NECESSARY COLUMNS 
+column group). Another strategy is to update statistics incrementally. These
+strategies can be used together if desired.
+
+To use the incremental update statistics feature, you must first create
+statistics for the table and create a persistent sample table. One way to
+do this is to perform a normal update statistics command, adding the
+PERSISTENT keyword to the _sample-option_. Another way to do this if you
+already have reasonably up-to-date statistics for the table, is to create
+a persistent sample table separately using the CREATE SAMPLE option.
+
+You can then perform update statistics incrementally by using the INCREMENTAL
+WHERE _predicate_ syntax in the on-clause. The _predicate_ should be chosen
+to describe the set of rows that have changed since the last statistics update
+was performed. For example, if your table contains a column with a timestamp
+giving the date and time of last update, this is a particularly useful column
+to use in the _predicate_.
+
+If you decide later that you wish to change the _percent_ sampling rate used
+for the persistent sample table, you can do so by dropping the persistent
+sample table (using REMOVE SAMPLE) and creating a new one (by using the
+CREATE SAMPLE option). Using a higher _percent_ results in more accurate
+histograms, but at the price of a longer-running operation.
+
 <<<
 [[update_statistics_examples]]
 === Examples of UPDATE STATISTICS
@@ -1108,4 +1169,23 @@ table ADDRESS:
 UPDATE STATISTICS FOR TABLE address ON street CLEAR;
 ```
 
+* This example generates statistics but also creates a persistent 
+sample table for use when updating statistics incrementally:
++
+```
+UPDATE STATISTICS FOR TABLE address
+ON (street), (city), (state), (zip, type)
+SAMPLE RANDOM 5 PERCENT PERSISTENT;
+```
 
+* This example updates statistics incrementally. It assumes that
+a persistent sample table has already been created. The predicate
+in the WHERE clause describes the set of rows that have changed
+since statistics were last updated. Here we assume that rows
+with a state of California are the only rows that have changed:
++
+```
+UPDATE STATISTICS FOR TABLE address
+ON EXISTING COLUMNS
+INCREMENTAL WHERE state = 'CA';
+```


[2/3] incubator-trafodion git commit: Update error messages

Posted by db...@apache.org.
Update error messages


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/a4a538ed
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/a4a538ed
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/a4a538ed

Branch: refs/heads/master
Commit: a4a538ed89b4fd1be8255e62515b4e694e1f057a
Parents: 36446ce
Author: Dave Birdsall <db...@apache.org>
Authored: Thu Sep 15 23:37:01 2016 +0000
Committer: Dave Birdsall <db...@apache.org>
Committed: Thu Sep 15 23:37:01 2016 +0000

----------------------------------------------------------------------
 .../src/asciidoc/_chapters/about.adoc           |   4 +-
 .../src/asciidoc/_chapters/sort_msgs.adoc       | 211 +-------
 .../asciidoc/_chapters/update_stats_msgs.adoc   | 482 +++++++++++++++++++
 docs/messages_guide/src/asciidoc/index.adoc     |   1 +
 4 files changed, 487 insertions(+), 211 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a4a538ed/docs/messages_guide/src/asciidoc/_chapters/about.adoc
----------------------------------------------------------------------
diff --git a/docs/messages_guide/src/asciidoc/_chapters/about.adoc b/docs/messages_guide/src/asciidoc/_chapters/about.adoc
index 586b010..85099cc 100644
--- a/docs/messages_guide/src/asciidoc/_chapters/about.adoc
+++ b/docs/messages_guide/src/asciidoc/_chapters/about.adoc
@@ -36,7 +36,9 @@ programmers who use the {project-name} database software conversational or
 programmatic interface.
 
 == New and Changed Information
-This is a new manual.
+
+Messages for UPDATE STATISTICS have been corrected. Also messages for
+the new incremental UPDATE STATISTICS features have been added.
 
 == Notation Conventions
 This list summarizes the notation conventions for syntax presentation in this manual.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a4a538ed/docs/messages_guide/src/asciidoc/_chapters/sort_msgs.adoc
----------------------------------------------------------------------
diff --git a/docs/messages_guide/src/asciidoc/_chapters/sort_msgs.adoc b/docs/messages_guide/src/asciidoc/_chapters/sort_msgs.adoc
index 9039a57..d602a1a 100644
--- a/docs/messages_guide/src/asciidoc/_chapters/sort_msgs.adoc
+++ b/docs/messages_guide/src/asciidoc/_chapters/sort_msgs.adoc
@@ -24,217 +24,8 @@
 ////
 
 [[sort-messages]]
-= Sort Messages (9200 through 10049)
+= Sort Messages (10000 through 10049)
 
-[[SQL-9200]]
-== SQL 9200
-
-```
-UPDATE STATISTICS encountered an error from statement <name>.
-```
-
-*Cause:* UPDATE STATISTICS encountered an error from the {project-name} statement <name>.
-
-*Effect:* The operation fails.
-
-*Recovery:* Other error messages will appear with this one, depending on
-what statement caused the error. Use them to diagnose and correct the
-problem.
-
-[[SQL-9201]]
-== SQL 9201
-
-```
-Unable to DROP object <name>.
-```
-
-*Cause:* UPDATE STATISTICS encountered an error during a DROP of the
-object <name>.
-
-*Effect:* {project-name} is unable to continue processing.
-
-*Recovery:* Resubmit the statement. If this does not correct the problem, stop and restart {project-name}. 
-If this does not correct the problem, 
-contact {project-support}.
-
-<<<
-[[SQL-9202]]
-== SQL 9202
-
-```
-UPDATE STATISTICS has located previously generated histograms that are not being regenerated. This may affect the plans that will be generated. Missing column lists are <column-list>.
-```
-
-*Cause:* UPDATE STATISTICS has located previously generated histograms that are not being regenerated.
-
-*Effect:* Processing continues without interruption.
-
-*Recovery:* Remove or replace previously generated histograms by
-performing either one of these two recovery actions:
-
-* Re-execute the same UPDATE STATISTICS command, but also include the
-<column-list> from the message.
-* Perform UPDATE STATISTICS FOR the table. Then re-execute UPDATE
-STATISTICS with the column lists in which you are interested.
-
-[[SQL-9203]]
-== SQL 9203
-
-```
-Column names must be unique when specified in column list: (<name>).
-```
-
-*Cause:* You specified a non unique column name in the specified column list.
-
-*Effect:* {project-name} is unable to continue processing.
-
-*Recovery:* Correct the syntax and resubmit.
-
-<<<
-[[SQL-9204]]
-== SQL 9204
-
-```
-Invalid option <option> specified. Value must be <range>.
-```
-
-*Cause:* You specified an invalid option for UPDATE STATISTICS. The
-value <range> specifies the valid range for this option.
-
-*Effect:* {project-name} is unable to continue
-processing.
-
-*Recovery:* Correct the syntax and resubmit.
-
-[[SQL-9205]]
-== SQL 9205
-
-```
-UPDATE STATISTICS is not supported for object <name>.
-```
-
-*Cause:* You attempted to run UPDATE STATISTICS against an object that is not supported.
-
-*Effect:* {project-name} is unable to continue processing.
-
-*Recovery:* Correct the syntax and resubmit.
-
-<<<
-[[SQL-9206]]
-== SQL 9206
-
-```
-You are not authorized to read/write object <name>. Verify that you have the necessary access privileges.
-```
-
-*Cause:* {project-name} could not perform an UPDATE
-STATISTICS statement because you are not authorized to perform this
-operation against this table. You must either own the object <name> or
-be the super ID.
-
-*Effect:* {project-name} is unable to continue processing.
-
-*Recovery:* Resubmit after checking the table location and access privileges.
-
-[[SQL-9207]]
-== SQL 9207
-
-```
-The specified SAMPLE option generated an empty sample set. Modify the SAMPLE option and resubmit.
-```
-
-*Cause:* The SAMPLE option you specified generated an empty sample set.
-
-*Effect:* {project-name} is unable to continue processing.
-
-*Recovery:* Modify the SAMPLE option and resubmit.
-
-<<<
-[[SQL-9208]]
-== SQL 9208
-
-```
-Column definitions could not be accessed.
-```
-
-*Cause:* An UPDATE STATISTICS statement was unable to access column definitions.
-
-*Effect:* The operation fails.
-
-*Recovery:* Resubmit the statement. If this does not correct the
-problem, stop and restart the {project-name} database software. If this does
-not correct the problem, report the entire message to {project-support}.
-
-[[SQL-9209]]
-== SQL 9209
-
-```
-Column <name> does not exist in object <name>.
-```
-
-*Cause:* You tried to access column <name>, which does not exist in object <name>.
-
-*Effect:* The operation fails.
-
-*Recovery:* Check the column <name> and resubmit.
-
-<<<
-[[SQL-9210]]
-== SQL 9210
-
-```
-One of the column data types is not supported by UPDATE STATISTICS. You must exclude this column from the column list in UPDATE STATISTICS.
-```
-
-*Cause:* You attempted to perform UPDATE STATISTICS on a column whose data type does not support this operation.
-
-*Effect:* The operation fails.
-
-*Recovery:* Exclude this column from the column list and resubmit.
-
-[[SQL-9212]]
-== SQL 9212
-
-```
-Cardinality statistics will be more accurate if you use the SET ROWCOUNT option in the SAMPLE clause.
-```
-
-*Cause:* The SET ROWCOUNT option was not used in the SAMPLE clause.
-
-*Effect:* Processing continues without interruption.
-
-*Recovery:* Provide SET ROWCOUNT option and resubmit for more accurate statistics.
-
-<<<
-[[SQL-9213]]
-== SQL 9213
-
-```
-If you intend to update histogram statistics for columns, you must specify a column list in the statement.
-```
-
-*Cause:* You attempted to perform UPDATE STATISTICS and did not specify a column list.
-
-*Effect:* Processing continues without interruption.
-
-*Recovery:* Correct your syntax to specify the column list and resubmit.
-
-[[SQL-9214]]
-== SQL 9214
-
-```
-Object <name> could not be created.
-```
-
-*Cause:* UPDATE STATISTICS encountered an error during a CREATE of the object <name>.
-
-*Effect:* {project-name} is unable to continue processing.
-
-*Recovery:* Resubmit the statement. If this does not correct the
-problem, stop and restart the {project-name} database software. If this does
-not correct the problem, report the entire message to {project-support}.
-
-<<<
 [[SQL-10007-]]
 == SQL 10007 
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a4a538ed/docs/messages_guide/src/asciidoc/_chapters/update_stats_msgs.adoc
----------------------------------------------------------------------
diff --git a/docs/messages_guide/src/asciidoc/_chapters/update_stats_msgs.adoc b/docs/messages_guide/src/asciidoc/_chapters/update_stats_msgs.adoc
new file mode 100644
index 0000000..d3174ac
--- /dev/null
+++ b/docs/messages_guide/src/asciidoc/_chapters/update_stats_msgs.adoc
@@ -0,0 +1,482 @@
+////
+/**
+* @@@ START COPYRIGHT @@@
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+////
+
+[[update-stats-messages]]
+= Update Statistics Messages (9200 through 9299)
+
+[[SQL-9200]]
+== SQL 9200
+
+```
+UPDATE STATISTICS for table <name> encountered an error <details> from statement <statement-name>.
+```
+
+*Cause:* UPDATE STATISTICS for the given table encountered an error from the {project-name} statement <statement-name>.
+
+*Effect:* The operation fails.
+
+*Recovery:* Other error messages will appear with this one, depending on
+what statement caused the error. Use them to diagnose and correct the
+problem.
+
+[[SQL-9201]]
+== SQL 9201
+
+```
+Unable to DROP object <name>.
+```
+
+*Cause:* UPDATE STATISTICS encountered an error during a DROP of the
+object <name>.
+
+*Effect:* {project-name} is unable to continue processing.
+
+*Recovery:* Resubmit the statement. If this does not correct the problem, stop and restart {project-name}. 
+If this does not correct the problem, 
+contact {project-support}.
+
+<<<
+[[SQL-9202]]
+== SQL 9202
+
+```
+UPDATE STATISTICS has located previously generated histograms that are not being regenerated. This may affect the plans that will be generated. Missing column lists are <column-list>.
+```
+
+*Cause:* UPDATE STATISTICS has located previously generated histograms that are not being regenerated.
+
+*Effect:* Processing continues without interruption.
+
+*Recovery:* Remove or replace previously generated histograms by
+performing one of these recovery actions:
+
+* Re-execute the same UPDATE STATISTICS command, but also include the
+<column-list> from the message.
+* Re-execute the same UPDATE STATISTICS command with just the <column-list> from the message. (Note that you will get another 9202 warning for the columns you have just processed. That can be ignored.)
+* Execute an UPDATE STATISTICS CLEAR to discard these histograms if they are no longer needed.
+
+[[SQL-9203]]
+== SQL 9203
+
+```
+Column names must be unique when specified in column list: (<name>).
+```
+
+*Cause:* You specified a duplicate column name in the specified column list.
+
+*Effect:* {project-name} is unable to continue processing.
+
+*Recovery:* Correct the syntax and resubmit.
+
+<<<
+[[SQL-9204]]
+== SQL 9204
+
+```
+Invalid option <option> specified. Value must be <range>.
+```
+
+*Cause:* You specified an invalid option for UPDATE STATISTICS. The
+value <range> specifies the valid range for this option.
+
+*Effect:* {project-name} is unable to continue
+processing.
+
+*Recovery:* Correct the syntax and resubmit.
+
+[[SQL-9205]]
+== SQL 9205
+
+```
+UPDATE STATISTICS is not supported for object <name>.
+```
+
+*Cause:* You attempted to run UPDATE STATISTICS against an object that is not supported.
+
+*Effect:* {project-name} is unable to continue processing.
+
+*Recovery:* If a different object <name> was intended, correct the syntax and resubmit.
+
+<<<
+[[SQL-9206]]
+== SQL 9206
+
+```
+You are not authorized to read/write object <name>. Verify that you have the necessary access privileges.
+```
+
+*Cause:* {project-name} could not perform an UPDATE
+STATISTICS statement because you are not authorized to perform this
+operation against this table. You must either own the object <name> or
+be the super ID.
+
+*Effect:* {project-name} is unable to continue processing.
+
+*Recovery:* Resubmit after checking the table access privileges.
+
+[[SQL-9207]]
+== SQL 9207
+
+```
+The specified SAMPLE option generated an empty sample set. Modify the SAMPLE option and resubmit.
+```
+
+*Cause:* The SAMPLE option you specified generated an empty sample set.
+
+*Effect:* {project-name} is unable to continue processing.
+
+*Recovery:* Modify the SAMPLE option and resubmit.
+
+<<<
+[[SQL-9208]]
+== SQL 9208
+
+```
+Column definitions could not be accessed.
+```
+
+*Cause:* An UPDATE STATISTICS statement was unable to access column definitions.
+
+*Effect:* The operation fails.
+
+*Recovery:* Resubmit the statement. If this does not correct the
+problem, stop and restart the {project-name} database software. If this does
+not correct the problem, report the entire message to {project-support}.
+
+[[SQL-9209]]
+== SQL 9209
+
+```
+Column <name> does not exist in object <name>.
+```
+
+*Cause:* You tried to access column <name>, which does not exist in object <name>.
+
+*Effect:* The operation fails.
+
+*Recovery:* Check the column <name> and resubmit.
+
+<<<
+[[SQL-9210]]
+== SQL 9210
+
+```
+One of the column data types is not supported by UPDATE STATISTICS. You must exclude this column from the column list in UPDATE STATISTICS.
+```
+
+*Cause:* You attempted to perform UPDATE STATISTICS on a column whose data type does not support this operation.
+
+*Effect:* The operation fails.
+
+*Recovery:* Exclude this column from the column list and resubmit.
+
+[[SQL-9211]]
+== SQL 9211
+
+```
+In an UPDATE STATISTICS statement that specifies <option>, the ON clause may contain only an EXISTING or NECESSARY clause.
+```
+
+*Cause:* You specified some ON clause other than ON EXISTING COLUMNS or ON NECESSARY COLUMNS
+with the given <option>.
+
+*Effect:* {project-name} is unable to continue
+processing.
+
+*Recovery:* Correct the syntax and resubmit.
+
+<<<
+[[SQL-9212]]
+== SQL 9212
+
+```
+Cardinality statistics will be more accurate if you use the SET ROWCOUNT option in the SAMPLE clause.
+```
+
+*Cause:* The SET ROWCOUNT option was not used in the SAMPLE clause.
+
+*Effect:* Processing continues without interruption.
+
+*Recovery:* Provide SET ROWCOUNT option and resubmit for more accurate statistics.
+
+[[SQL-9213]]
+== SQL 9213
+
+```
+If you intend to update histogram statistics for columns, you must specify a column list in the statement.
+```
+
+*Cause:* You attempted to perform UPDATE STATISTICS and did not specify a column list.
+
+*Effect:* Processing continues without interruption.
+
+*Recovery:* Correct your syntax to specify the column list and resubmit.
+
+<<<
+[[SQL-9214]]
+== SQL 9214
+
+```
+Object <name> could not be created.
+```
+
+*Cause:* UPDATE STATISTICS encountered an error during a CREATE of the object <name>.
+
+*Effect:* {project-name} is unable to continue processing.
+
+*Recovery:* Resubmit the statement. If this does not correct the
+problem, stop and restart the {project-name} database software. If this does
+not correct the problem, report the entire message to {project-support}.
+
+[[SQL-9215]]
+== SQL 9215
+
+```
+UPDATE STATISTICS encountered an internal error (from <function-name>, with return value=<value>).  Details: <details>.
+```
+
+*Cause:* UPDATE STATISTICS encountered an internal error. This message may be accompanied by other
+messages that provide further information.
+
+*Effect:* {project-name} is unable to continue processing.
+
+*Recovery:* Resubmit the statement. If this does not correct the problem, stop and restart {project-name}. 
+If this does not correct the problem, 
+contact {project-support}.
+
+<<<
+[[SQL-9217]]
+== SQL 9217
+
+```
+The statement will have no effect because no histograms are currently maintained for the table.
+```
+
+*Cause:* UPDATE STATISTICS ON EXISTING COLUMNS was specified but the table has no existing
+statistics.
+
+*Effect:* The operation is a no-op.
+
+*Recovery:* If this was not the intended statement correct and resubmit. Otherwise no recovery
+is necessary.
+
+[[SQL-9218]]
+== SQL 9218
+
+```
+The statement will have no effect because no histograms need to be updated.
+```
+
+*Cause:* UPDATE STATISTICS ON NECESSARY COLUMNS was specified but the table has no columns
+that lack statistics and need them.
+
+*Effect:* The operation is a no-op.
+
+*Recovery:* If this was not the intended statement correct and resubmit. Otherwise no recovery
+is necessary.
+
+<<<
+[[SQL-9221]]
+== SQL 9221
+
+```
+Incremental UPDATE STATISTICS cannot be performed due to the absence of the IUS persistent sample table for <table>.  Use a regular UPDATE STATISTICS command with the sample clause and PERSISTENT first to create such a persistent sample table.
+```
+
+*Cause:* UPDATE STATISTICS INCREMENTAL was specified but the table does not have a persistent
+sample table.
+
+*Effect:* {project-name} is unable to continue processing.
+
+*Recovery:* Create a persistent sample table as suggested in the message.
+
+[[SQL-9228]]
+== SQL 9228
+
+```
+There were no sample tables to drop.
+```
+
+*Cause:* UPDATE STATISTICS REMOVE SAMPLE was specified but the table does not have 
+a persistent sample table.
+
+*Effect:* The operation is a no-op.
+
+*Recovery:* If this was not the intended statement correct and resubmit. Otherwise no recovery
+is necessary.
+
+<<<
+[[SQL-9232]]
+== SQL 9232
+
+```
+Incremental UPDATE STATISTICS: cannot proceed because of the on-going IUS transaction originated at <details>. 
+```
+
+*Cause:* UPDATE STATISTICS INCREMENTAL was specified, but {project-name} detected that
+another UPDATE STATISTICS INCREMENTAL operation was already in progress for the same object.
+
+*Effect:* {project-name} is unable to continue processing.
+
+*Recovery:* If this was not the intended statement correct and resubmit. Otherwise no recovery
+is necessary.
+
+[[SQL-9240]]
+== SQL 9240
+
+```
+ON EVERY KEY option is not yet implemented for Update Statistics on <table-type> tables. 
+```
+
+*Cause:* UPDATE STATISTICS ON EVERY KEY was specified, but {project-name} does not yet
+support this clause on tables of the given type.
+
+*Effect:* {project-name} is unable to continue processing.
+
+*Recovery:* If this was not the intended statement correct and resubmit. Otherwise no recovery
+is necessary.
+
+<<<
+[[SQL-9241]]
+== SQL 9241
+
+```
+Insufficient privileges to perform the statistics request for table <table-name>.
+```
+
+*Cause:* {project-name} could not perform an UPDATE
+STATISTICS statement because you are not authorized to perform this
+operation against this table. You must either own the object <name> or
+be the super ID.
+
+*Effect:* {project-name} is unable to continue processing.
+
+*Recovery:* Resubmit after checking the table access privileges.
+
+[[SQL-9242]]
+== SQL 9242
+
+```
+Unable to create schema for Hive statistics.
+```
+
+*Cause:* {project-name} could not perform an UPDATE
+STATISTICS statement against a Hive table because it was unable to create
+the necessary Trafodion schema to store histogram statistics.
+
+*Effect:* {project-name} is unable to continue processing.
+
+*Recovery:* Resubmit after checking schema create privileges.
+
+<<<
+[[SQL-9243]]
+== SQL 9243
+
+```
+This UPDATE STATISTICS command may take too long. It is recommended to use the SAMPLE clause instead. If you wish to do this without a SAMPLE clause, specify NO SAMPLE explicitly.
+```
+
+*Cause:* {project-name} detected that UPDATE STATISTICS was being performed against a very
+large table without sampling.
+
+*Effect:* {project-name} does not continue processing.
+
+*Recovery:* If the intent was to sample, add a SAMPLE clause and resubmit. If the intent was to
+perform UPDATE STATISTICS without sampling, add a NO SAMPLE clause and resubmit. Note that in the
+latter case, the operation is likely to take a long time.
+
+[[SQL-9244]]
+== SQL 9244
+
+```
+UPDATE STATISTICS is not allowed in a user transaction.
+```
+
+*Cause:* {project-name} detected that UPDATE STATISTICS was being performed inside a user transaction.
+
+*Effect:* {project-name} is unable to continue processing.
+
+*Recovery:* Either commit or rollback the user transaction. Then resubmit the statement outside of 
+a user transaction.
+
+<<<
+[[SQL-9245]]
+== SQL 9245
+
+```
+Unexpected out-of-order data encountered during histogram construction on column <column-name> this might result in later 6004 warnings.
+```
+
+*Cause:* {project-name} detected out-of-order data while generating histograms. This is likely an
+internal error. The operation continued, however.
+
+*Effect:* Warning 6004 may occur if the given column is subsequently referenced in a query.
+
+*Recovery:* Please capture a SHOWSTATS DETAIL of the histogram data and forward to {project-support}. 
+Afterwards, resubmitting the UPDATE STATISTICS command may clear this warning.
+
+[[SQL-9246]]
+== SQL 9246
+
+```
+UPDATE STATISTICS is not supported on LOB columns. Column <column-name> is a LOB column.
+```
+
+*Cause:* The UPDATE STATISTICS statement specifies generating histograms on the column named, but
+the column is a BLOB or CLOB column. {project-name} does not support statistics on BLOB or CLOB
+columns.
+
+*Effect:* {project-name} is unable to continue processing.
+
+*Recovery:* Remove the given column from the ON clause _column-list_ and resubmit.
+
+<<<
+[[SQL-9247]]
+== SQL 9247
+
+```
+UPDATE STATISTICS is not supported on volatile tables presently.
+```
+
+*Cause:* The UPDATE STATISTICS statement specifies a volatile table. {project-name} does not support statistics on volatile tables.
+
+*Effect:* {project-name} is unable to continue processing.
+
+*Recovery:* If this was not the intended statement correct and resubmit.
+
+[[SQL-9251]]
+== SQL 9251
+
+```
+A persistent sample table already exists. Use UPDATE STATISTICS REMOVE SAMPLE to drop it first if desired.
+```
+
+*Cause:* The UPDATE STATISTICS statement attempts to create a persistent sample table, but 
+{project-name} detected that one already exists.
+
+*Effect:* {project-name} is unable to continue processing.
+
+*Recovery:* If desired, drop the existing persistent sample table, then resubmit.
+

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a4a538ed/docs/messages_guide/src/asciidoc/index.adoc
----------------------------------------------------------------------
diff --git a/docs/messages_guide/src/asciidoc/index.adoc b/docs/messages_guide/src/asciidoc/index.adoc
index 1cedf3b..408a1c8 100644
--- a/docs/messages_guide/src/asciidoc/index.adoc
+++ b/docs/messages_guide/src/asciidoc/index.adoc
@@ -57,6 +57,7 @@ include::asciidoc/_chapters/parser_msgs.adoc[]
 include::asciidoc/_chapters/optimizer_msgs.adoc[]
 include::asciidoc/_chapters/generator_msgs.adoc[]
 include::asciidoc/_chapters/executor_msgs.adoc[]
+include::asciidoc/_chapters/update_stats_msgs.adoc[]
 include::asciidoc/_chapters/sort_msgs.adoc[]
 include::asciidoc/_chapters/udr_language_mgr_msgs.adoc[]
 include::asciidoc/_chapters/sqlstate.adoc[]


[3/3] incubator-trafodion git commit: Merge [TRAFODION-2164] PR 707 Add incremental upd stats documentation

Posted by db...@apache.org.
Merge [TRAFODION-2164] PR 707 Add incremental upd stats documentation


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/b6b9f43b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/b6b9f43b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/b6b9f43b

Branch: refs/heads/master
Commit: b6b9f43b60779b510cfdccd0e1c1612fc4c63376
Parents: 66827b0 a4a538e
Author: Dave Birdsall <db...@apache.org>
Authored: Mon Sep 19 16:50:06 2016 +0000
Committer: Dave Birdsall <db...@apache.org>
Committed: Mon Sep 19 16:50:06 2016 +0000

----------------------------------------------------------------------
 .../src/asciidoc/_chapters/about.adoc           |   4 +-
 .../src/asciidoc/_chapters/sort_msgs.adoc       | 211 +-------
 .../asciidoc/_chapters/update_stats_msgs.adoc   | 482 +++++++++++++++++++
 docs/messages_guide/src/asciidoc/index.adoc     |   1 +
 docs/shared/revisions.txt                       |   1 +
 .../src/asciidoc/_chapters/about.adoc           |  15 +-
 .../src/asciidoc/_chapters/sql_statements.adoc  |   4 +
 .../src/asciidoc/_chapters/sql_utilities.adoc   |  86 +++-
 8 files changed, 576 insertions(+), 228 deletions(-)
----------------------------------------------------------------------