我有一个select语句,它使用通配符搜索与其他表连接,这个语句的表现很荒谬
Oralce有没有办法使用带有LIKE'%string%'子句的索引?
SQL
WITH x AS
(SELECT /*+ PARALLEL(a 8) PARALLEL(b 8) ORDERED */
a.location AS a_name, UPPER (b.name) b_name
FROM table_a a LEFT OUTER JOIN table_b b ON b.name LIKE (LOWER ('%' || a.name) || '%')
ORDER BY a_name, b_name)
SELECT DISTINCT a_name, b_name
FROM x;
答案 0 :(得分:1)
尝试使用Oracle全文索引。