Fix NDVRemain and FreqRemain calculation
For text, varchar, char and bpchar, ORCA does not collect the
MCV and Histogram information, so the calculation of NDVRemain and
FreqRemain must be updated to account for it.
For such columns, NDVRemain is the stadistinct as available in the
pg_statistic, and FreqRemain is everything except the NULL frequency.
Earlier, NDVRemain and FreqRemain for such columns would yield 0
resulting in poor cardinality estimation and suboptimal plans.
Signed-off-by: NEkta Khanna <ekhanna@pivotal.io>
Showing
想要评论请 注册 或 登录