Skip to content
Discussion options

You must be logged in to vote

Although tidb_opt_enable_late_materialization is on by default, as I mentioned before, which predicate to pushdown to TableScan is totally cost decided, and in you case the optimizer decide not to pushdown to TableScan.
One of the reason is that in TiDB, we does estimate the filter rate for complex filter like like, currently we simply use 0.8 as the match rate. There is another variable to control the math rate: tidb_default_string_match_selectivity, as workaround, you can also try this query

select /*+ set_var(tidb_default_string_match_selectivity=0.00001) */ * from benchmark_table where attr_14 like '%70404 Port Viachester%';

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
3 replies
@den-crane
Comment options

@windtalker
Comment options

Answer selected by den-crane
@den-crane
Comment options

Comment options

You must be logged in to vote
1 reply
@den-crane
Comment options

Comment options

You must be logged in to vote
1 reply
@den-crane
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants