bad cardinality estimates for metadata queries
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Trafodion |
Fix Released
|
High
|
taoufik ben abdellatif |
Bug Description
cardinality estimation for metadata queries is not correct. Specifically for the case of an index join and the join is on the index column. The cardinality of the join should reflect that of the left child of the join.
Example of a metadata table that has the issue:
prepare st1 from select T.CONSTRAINT_TYPE, o.OBJECT_NAME from trafodion.
>>explain options 'f' st1;
LC RC OP OPERATOR OPT DESCRIPTION CARD
---- ---- ---- -------
3 . 4 root 5.00E+003
2 1 3 hybrid_hash_join 5.00E+003
. . 2 trafodion_
. . 1 trafodion_scan TABLE_CONSTRAINTS 1.00E+002
--- SQL operation complete.
>>
Changed in trafodion: | |
assignee: | nobody → taoufik ben abdellatif (taoufik-abdellatif) |
importance: | Undecided → High |
status: | New → In Progress |
tags: | added: sql-cmp |
information type: | Proprietary → Public |
Changes were made to method HistogramCache: :createColStats List in optimizer/ NATable. cpp to look for columns that have unique indices specified on them and flag them as unique. The FetchHistograms logic in hs_read.cpp uses this flag to set the uec of the column to be the same as the table rowcount.