今天发现一条语句导致latch free,而该条语句之前没有任何问题。
语句如下:
select * from t where reverse(a.report_id) like ‘_9859009002623000209%’)
本来应该利用上该表上的反序索引。但是因为下划线在sql里面是特殊字符,所以选择了全表扫描。
如果要使用该index,select * from t where reverse(a.report_id) like ‘\_9859009002623000209%’) escape ‘\’;
进行转义。
