You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "David Wayne Birdsall (JIRA)" <ji...@apache.org> on 2018/07/23 23:11:00 UTC

[jira] [Work started] (TRAFODION-3158) Bad histogram values are sometimes not reported

     [ https://issues.apache.org/jira/browse/TRAFODION-3158?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Work on TRAFODION-3158 started by David Wayne Birdsall.
-------------------------------------------------------
> Bad histogram values are sometimes not reported
> -----------------------------------------------
>
>                 Key: TRAFODION-3158
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-3158
>             Project: Apache Trafodion
>          Issue Type: Bug
>          Components: sql-cmp
>    Affects Versions: 2.3
>            Reporter: David Wayne Birdsall
>            Assignee: David Wayne Birdsall
>            Priority: Major
>
> Function EncodedValue::constructorFunction has logic to raise a 6003 warning if it encounters invalid values in histogram intervals. When this happens, the compiler generates a default histogram for that column (that is, it behaves as if it has no statistics for that column.) This can lead to poor query plans. In some circumstances, however, this warning does not get reported, so the user is not aware of the possible compromise in plan quality.
> An example of this can be created as follows:
>  # Create a Hive table Test1 with columns (a int, b int). Put some data into it, and in Trafodion, use UPDATE STATISTICS FOR TABLE HIVE.HIVE.TEST1 to generate statistics for it.
>  # Outside of Trafodion (in the Hive shell, say), drop and recreate the Hive table, but this time with columns (a string, b string). Populate that with a few rows.
>  # In a fresh sqlci session, do "prepare s1 from select a,b from hive.hive.test1 where a < 'abcd';". This will appear to be successful, however in fact 6003 warnings were generated internally but not reported.
> Another way to create an example is to create a Trafodion table, test1, with columns (a char(4), b char(4). Put some rows into it and do UPDATE STATISTICS on it. Then manually alter the boundary value in one of the SB_HISTOGRAM_INTERVALS tables, changing a value from a character string literal to a numeric literal. For example, change "('abcd')" to "(3)".



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)