Repository: incubator-trafodion Updated Branches: refs/heads/master 4639458b0 -> 68bd0a672
[TRAFODION-2839] Change Incr UPDATE STATS to not use CBFs by default Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/149d1cfe Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/149d1cfe Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/149d1cfe Branch: refs/heads/master Commit: 149d1cfed176c511f8ac4826d840af7b5894c625 Parents: 4639458 Author: Dave Birdsall <[email protected]> Authored: Thu Dec 14 21:05:43 2017 +0000 Committer: Dave Birdsall <[email protected]> Committed: Thu Dec 14 21:05:43 2017 +0000 ---------------------------------------------------------------------- core/sql/regress/compGeneral/EXPECTED023 | 51 +++++++++++++-------------- core/sql/regress/compGeneral/FILTER023 | 2 +- core/sql/sqlcomp/nadefaults.cpp | 5 ++- core/sql/ustat/hs_globals.cpp | 8 +++-- 4 files changed, 34 insertions(+), 32 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/149d1cfe/core/sql/regress/compGeneral/EXPECTED023 ---------------------------------------------------------------------- diff --git a/core/sql/regress/compGeneral/EXPECTED023 b/core/sql/regress/compGeneral/EXPECTED023 index 46352b8..03beacb 100644 --- a/core/sql/regress/compGeneral/EXPECTED023 +++ b/core/sql/regress/compGeneral/EXPECTED023 @@ -125,7 +125,7 @@ STEST_EMPTY OBJECT_NAME SAMPLE_NAME REASON LAST_WHERE_PREDICATE ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -STEST TRAFODION.COMPGENERAL_TEST023.TRAF_SAMPLE_04737367368240681236_1508882731_922052 M +STEST TRAFODION.COMPGENERAL_TEST023.TRAF_SAMPLE_05715215834648412060_1513280032_959042 M --- 1 row(s) selected. >>-- should see one row @@ -141,7 +141,7 @@ SB_PERSISTENT_SAMPLES STEST STESTC STEST_EMPTY -TRAF_SAMPLE_04737367368240681236_1508882731_922052 +TRAF_SAMPLE_05715215834648412060_1513280032_959042 --- SQL operation complete. >> -- should be stest, stest_empty, stestc, sb_* tables + a sample table @@ -165,7 +165,7 @@ SB_PERSISTENT_SAMPLES STEST STESTC STEST_EMPTY -TRAF_SAMPLE_04737367368240681236_1508882785_656325 +TRAF_SAMPLE_05715215834648412060_1513280079_749188 --- SQL operation complete. >> -- should be stest, stest_empty, stestc, sb_* tables + a different sample >> table @@ -175,7 +175,7 @@ TRAF_SAMPLE_04737367368240681236_1508882785_656325 OBJECT_NAME SAMPLE_NAME REASON LAST_WHERE_PREDICATE ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -STEST TRAFODION.COMPGENERAL_TEST023.TRAF_SAMPLE_04737367368240681236_1508882785_656325 M +STEST TRAFODION.COMPGENERAL_TEST023.TRAF_SAMPLE_05715215834648412060_1513280079_749188 M --- 1 row(s) selected. >>-- should see one row @@ -222,7 +222,7 @@ SB_PERSISTENT_SAMPLES STEST STESTC STEST_EMPTY -TRAF_SAMPLE_04737367368240681236_1508882823_902847 +TRAF_SAMPLE_05715215834648412060_1513280122_597819 --- SQL operation complete. >> -- should be stest, stest_empty, stestc, sb_* tables + another sample table @@ -232,7 +232,7 @@ TRAF_SAMPLE_04737367368240681236_1508882823_902847 OBJECT_NAME SAMPLE_NAME REASON LAST_WHERE_PREDICATE ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -STEST TRAFODION.COMPGENERAL_TEST023.TRAF_SAMPLE_04737367368240681236_1508882823_902847 I +STEST TRAFODION.COMPGENERAL_TEST023.TRAF_SAMPLE_05715215834648412060_1513280122_597819 I --- 1 row(s) selected. >>-- should see one row @@ -256,7 +256,7 @@ SB_PERSISTENT_SAMPLES STEST STESTC STEST_EMPTY -TRAF_SAMPLE_04737367368240681236_1508882873_484291 +TRAF_SAMPLE_05715215834648412060_1513280167_871663 --- SQL operation complete. >> -- should be stest, stest_empty, stestc, sb_* tables + another sample table @@ -266,7 +266,7 @@ TRAF_SAMPLE_04737367368240681236_1508882873_484291 OBJECT_NAME SAMPLE_NAME REASON LAST_WHERE_PREDICATE ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -STEST TRAFODION.COMPGENERAL_TEST023.TRAF_SAMPLE_04737367368240681236_1508882873_484291 I +STEST TRAFODION.COMPGENERAL_TEST023.TRAF_SAMPLE_05715215834648412060_1513280167_871663 I --- 1 row(s) selected. >>-- should see one row @@ -327,7 +327,7 @@ STEST OBJECT_NAME SAMPLE_NAME REASON LAST_WHERE_PREDICATE ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -STEST TRAFODION.COMPGENERAL_TEST023.TRAF_SAMPLE_04737367368240681236_1508882873_484291 I c1 >= 100000 +STEST TRAFODION.COMPGENERAL_TEST023.TRAF_SAMPLE_05715215834648412060_1513280167_871663 I c1 >= 100000 --- 1 row(s) selected. >> @@ -384,8 +384,8 @@ SB_PERSISTENT_SAMPLES STEST STESTC STEST_EMPTY -TRAF_SAMPLE_04737367368240681236_1508882873_484291 -TRAF_SAMPLE_04737367368240683297_1508882959_040281 +TRAF_SAMPLE_05715215834648412060_1513280167_871663 +TRAF_SAMPLE_05715215834648413689_1513280221_712692 --- SQL operation complete. >> @@ -394,7 +394,7 @@ TRAF_SAMPLE_04737367368240683297_1508882959_040281 OBJECT_NAME SAMPLE_NAME REASON LAST_WHERE_PREDICATE ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -STESTC TRAFODION.COMPGENERAL_TEST023.TRAF_SAMPLE_04737367368240683297_1508882959_040281 I c1 >= 'naaaa' +STESTC TRAFODION.COMPGENERAL_TEST023.TRAF_SAMPLE_05715215834648413689_1513280221_712692 I c1 >= 'naaaa' --- 1 row(s) selected. >> @@ -419,8 +419,8 @@ SB_PERSISTENT_SAMPLES STEST STESTC STEST_EMPTY -TRAF_SAMPLE_04737367368240681236_1508882873_484291 -TRAF_SAMPLE_04737367368240683297_1508882959_040281 +TRAF_SAMPLE_05715215834648412060_1513280167_871663 +TRAF_SAMPLE_05715215834648413689_1513280221_712692 --- SQL operation complete. >> -- should be the same as previous "get tables" @@ -447,8 +447,8 @@ SB_PERSISTENT_SAMPLES STEST STESTC STEST_EMPTY -TRAF_SAMPLE_04737367368240681236_1508882873_484291 -TRAF_SAMPLE_04737367368240683297_1508882959_040281 +TRAF_SAMPLE_05715215834648412060_1513280167_871663 +TRAF_SAMPLE_05715215834648413689_1513280221_712692 --- SQL operation complete. >> -- should be the same as previous "get tables" @@ -476,8 +476,8 @@ SB_PERSISTENT_SAMPLES STEST STESTC STEST_EMPTY -TRAF_SAMPLE_04737367368240681236_1508882873_484291 -TRAF_SAMPLE_04737367368240683297_1508882959_040281 +TRAF_SAMPLE_05715215834648412060_1513280167_871663 +TRAF_SAMPLE_05715215834648413689_1513280221_712692 --- SQL operation complete. >> -- should be the same as previous "get tables" @@ -488,10 +488,9 @@ TRAF_SAMPLE_04737367368240683297_1508882959_040281 *** ERROR[9219] Incremental UPDATE STATISTICS: An operation failed, possibly due to an invalid WHERE clause. *** ERROR[15001] A syntax error occurred at or before: -UPSERT USING LOAD INTO TRAFODION.COMPGENERAL_TEST023.TRAF_SAMPLE_04737367368240 -681236_1508882873_484291_I (SELECT "C1", "C2", "C3" FROM TRAFODION.COMPGENERAL_ -TEST023.STEST WHERE 1 SAMPLE RANDOM 9.943000 PERCENT ); - ^ (195 characters from start of SQL statement) +DELETE WITH NO ROLLBACK FROM TRAFODION.COMPGENERAL_TEST023.TRAF_SAMPLE_05715215 +834648412060_1513280167_871663 WHERE 1; + ^ (119 characters from start of SQL statement) *** ERROR[8822] The statement was not prepared. @@ -508,8 +507,8 @@ SB_PERSISTENT_SAMPLES STEST STESTC STEST_EMPTY -TRAF_SAMPLE_04737367368240681236_1508882873_484291 -TRAF_SAMPLE_04737367368240683297_1508882959_040281 +TRAF_SAMPLE_05715215834648412060_1513280167_871663 +TRAF_SAMPLE_05715215834648413689_1513280221_712692 --- SQL operation complete. >> -- should be the same as previous "get tables" @@ -519,7 +518,7 @@ TRAF_SAMPLE_04737367368240683297_1508882959_040281 *** ERROR[9219] Incremental UPDATE STATISTICS: An operation failed, possibly due to an invalid WHERE clause. -*** ERROR[4001] Column BADCOL is not found. Tables in scope: TRAFODION.COMPGENERAL_TEST023.STEST. Default schema: TRAFODION.SCH. +*** ERROR[4001] Column BADCOL is not found. Tables in scope: TRAFODION.COMPGENERAL_TEST023.TRAF_SAMPLE_05715215834648412060_1513280167_871663. Default schema: TRAFODION.SCH. *** ERROR[8822] The statement was not prepared. @@ -560,7 +559,7 @@ SB_PERSISTENT_SAMPLES STEST STESTC STEST_EMPTY -TRAF_SAMPLE_04737367368240681236_1508882873_484291 +TRAF_SAMPLE_05715215834648412060_1513280167_871663 --- SQL operation complete. >> -- should be the same as previous "get tables" except only one sample table http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/149d1cfe/core/sql/regress/compGeneral/FILTER023 ---------------------------------------------------------------------- diff --git a/core/sql/regress/compGeneral/FILTER023 b/core/sql/regress/compGeneral/FILTER023 index 35672c1..c6f63fe 100755 --- a/core/sql/regress/compGeneral/FILTER023 +++ b/core/sql/regress/compGeneral/FILTER023 @@ -35,7 +35,7 @@ sed " s/TRAF_SAMPLE_[0-9]*_[0-9]*_[0-9]*/TRAF_SAMPLE_nn_nnnnnnnnnn_nnnnnn/g s/TRAF_SAMPLE_[0-9]*_[0-9]*/TRAF_SAMPLE_nn_nnnnnnnnnn/g s/TRAF_SAMPLE_[0-9]*/TRAF_SAMPLE_nn/g -s/E_[0-9]*_[0-9]*_[0-9]* WHERE/E_nn_nnnnnnnnnn_nnnnnn WHERE/g +s/[0-9]*_[0-9]*_[0-9]* WHERE/nn_nnnnnnnnnn_nnnnnn WHERE/g s/[0-9]*\.[0-9]* PERCENT/nn.nn PERCENT/g s/[0-9]*_[0-9]*_[0-9]*_I/nn_nnnnnnnnnn_nnnnnn_I/g s/[0-9]*_[0-9]*_I/nnnnnnnnnn_nnnnnn_I/g http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/149d1cfe/core/sql/sqlcomp/nadefaults.cpp ---------------------------------------------------------------------- diff --git a/core/sql/sqlcomp/nadefaults.cpp b/core/sql/sqlcomp/nadefaults.cpp index 8e65291..a75c20b 100644 --- a/core/sql/sqlcomp/nadefaults.cpp +++ b/core/sql/sqlcomp/nadefaults.cpp @@ -3081,9 +3081,8 @@ XDDkwd__(SUBQUERY_UNNESTING, "ON"), DDui___(USTAT_HBASE_SAMPLE_RETURN_INTERVAL, "10000000"), // Avoid scanner timeout by including on average at // least one row per this many when sampling within HBase. DDflt0_(USTAT_INCREMENTAL_FALSE_PROBABILITY, "0.01"), - DDkwd__(USTAT_INCREMENTAL_UPDATE_STATISTICS, "ON"), - // to the non-audited sample table must be done on same - // process it was created on. This CQD is NOT externalized. + DDkwd__(USTAT_INCREMENTAL_UPDATE_STATISTICS, "SAMPLE"), // "SAMPLE" ==> don't use Counting Bloom Filters + DDkwd__(USTAT_INTERNAL_SORT, "HYBRID"), DDkwd__(USTAT_IS_IGNORE_UEC_FOR_MC, "OFF"), // if MCIS is ON, use IS to compute SC stats http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/149d1cfe/core/sql/ustat/hs_globals.cpp ---------------------------------------------------------------------- diff --git a/core/sql/ustat/hs_globals.cpp b/core/sql/ustat/hs_globals.cpp index 5fc1ce5..bb764b2 100644 --- a/core/sql/ustat/hs_globals.cpp +++ b/core/sql/ustat/hs_globals.cpp @@ -7093,16 +7093,20 @@ Lng32 HSGlobalsClass::UpdateIUSPersistentSampleTable(Int64 oldSampleSize, } rowsAffected = 0; + + // The most likely error on the DELETE would be due to a bad WHERE clause. + // (When CQD USTAT_INCREMENTAL_UPDATE_STATISTICS is set to 'SAMPLE', this is + // the first place that we attempt to use the user's WHERE clause.) if (transactional) { - retcode = HSFuncExecTransactionalQueryWithRetry(deleteQuery, -UERR_INTERNAL_ERROR, + retcode = HSFuncExecTransactionalQueryWithRetry(deleteQuery, -UERR_IUS_BAD_WHERE_CLAUSE, &rowsAffected, "IUS delete from PS where", NULL, NULL); } else { - retcode = HSFuncExecQuery(deleteQuery, -UERR_INTERNAL_ERROR, + retcode = HSFuncExecQuery(deleteQuery, -UERR_IUS_BAD_WHERE_CLAUSE, &rowsAffected, "IUS delete from PS where", NULL, NULL);
