You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we meet some cases where the cardinality estimation of string matching functions (like and regexp) is bad. When the pattern is complex, we are unable to build the function into Ranges to estimate it with higher precision.
Enhancement
To mitigate this, we can use the statistics to estimate selectivity. Specifically, we can (1) evaluate the expressions with values in the TopN, and (2) consider the NULL count by evaluating the expressions with NULL.
Currently, for convenience and due to the limitation of current statistics, we only apply this optimization on expressions that only involve one column, only when this column is not a non-binary collation string column, and statistics on this column (or a single column index on this column) is available and it's ver2,
And we can also provide a variable to control the default selectivity of the string matching functions.
Currently, we will make the default behavior unchanged, and the user can use the variable to control the feature.
The text was updated successfully, but these errors were encountered:
Background
Currently, we meet some cases where the cardinality estimation of string matching functions (like and regexp) is bad. When the pattern is complex, we are unable to build the function into
Range
s to estimate it with higher precision.Enhancement
To mitigate this, we can use the statistics to estimate selectivity. Specifically, we can (1) evaluate the expressions with values in the TopN, and (2) consider the NULL count by evaluating the expressions with NULL.
Currently, for convenience and due to the limitation of current statistics, we only apply this optimization on expressions that only involve one column, only when this column is not a non-binary collation string column, and statistics on this column (or a single column index on this column) is available and it's ver2,
And we can also provide a variable to control the default selectivity of the string matching functions.
Currently, we will make the default behavior unchanged, and the user can use the variable to control the feature.
The text was updated successfully, but these errors were encountered: