You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "Alice Chen (JIRA)" <ji...@apache.org> on 2015/07/22 20:18:37 UTC

[jira] [Created] (TRAFODION-896) LP Bug: 1411472 - salt key histogram not requested by optimizer

Alice Chen created TRAFODION-896:
------------------------------------

             Summary: LP Bug: 1411472 - salt key histogram not requested by optimizer
                 Key: TRAFODION-896
                 URL: https://issues.apache.org/jira/browse/TRAFODION-896
             Project: Apache Trafodion
          Issue Type: Bug
          Components: sql-cmp
            Reporter: Julie Thai
            Assignee: Barry Fritchman
            Priority: Critical
             Fix For: 1.1 (pre-incubation)


Histogram for salt column is not requested by optimizer.

As per Qifan, primary key is (colkey1, colkey2). if the predicate is n the second key column, then salt column stats may be useful to figure out the MDAM plan.
SQL>prepare XX from select *
from TBLX where colkey2  = 1000;
*** WARNING[6011] Statistics for column (COLKEY1) from table TRAFODION.UPDATESTATS_AUTO.TBLX were not available. As a result, the access path chosen might not be the best possible. These statistics will be automatically generated at the next opportunity; however, you can generate them now by using UPDATE STATISTICS FOR TABLE TRAFODION.UPDATESTATS_AUTO.TBLX ON NECESSARY COLUMNS. [2014-12-23 18:21:20]
*** WARNING[6011] Statistics for column (COLKEY2) from table TRAFODION.UPDATESTATS_AUTO.TBLX were not available. As a result, the access path chosen might not be the best possible. These statistics will be automatically generated at the next opportunity; however, you can generate them now by using UPDATE STATISTICS FOR TABLE TRAFODION.UPDATESTATS_AUTO.TBLX ON NECESSARY COLUMNS. [2014-12-23 18:21:20]
--- SQL command prepared.

SQL>execute show_hist;
(EXPR)                                        READ_TIME           READ_COUNT REASON
--------------------------------------------- ------------------- ---------- ------
TBLX.COLKEY1                                   0001-01-01 00:00:00          0
TBLX.COLKEY2                                   0001-01-01 00:00:00          0

--- 2 row(s) selected.

SQL>update statistics for
table TBLX on necessary columns;
--- SQL operation complete.

SQL>execute show_hist;
(EXPR)                                        READ_TIME           READ_COUNT REASON
--------------------------------------------- ------------------- ---------- ------
TBLX.COLKEY1                                   0001-01-01 00:00:00          0 I
TBLX.COLKEY2                                   0001-01-01 00:00:00          0 I

--- 2 row(s) selected.

As per Barry:
prepare s from select o_custkey from orders where o_shippriority > 2;
    histograms for both o_orderkey (primary key) and o_shippriority are requested.
prepare s from select o_custkey from orders where "_SALT_">2;
    only o_orderkey histogram was requested.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)