我在表a的cateid上创建了普通索引,在name自段上建立了全文索引。
隐藏分布执行下面两个sql语句是很快的:
select id from a where cateid=1978
select id from a_companybaseinfo where contains(name,'xiaot',1)>0但要检索同时满足这两个条件的数据执行效率就很慢了。
select id from a where cateid=1978 and contains(name,'xiaot',1)>0我看了执行计划:好像只使用了全文索引这个索引。而没有两个索引都被使用上
隐藏分布执行下面两个sql语句是很快的:
select id from a where cateid=1978
select id from a_companybaseinfo where contains(name,'xiaot',1)>0但要检索同时满足这两个条件的数据执行效率就很慢了。
select id from a where cateid=1978 and contains(name,'xiaot',1)>0我看了执行计划:好像只使用了全文索引这个索引。而没有两个索引都被使用上
那是因为oracle发现两个索引扫描的代价超过了全表扫描要么把执行计划和表的情况贴上来,让大家看下是否有别的办法,
要么就优化下全表扫描