I’d like to index queries like x like '%abc%'
If I have a table like the following
create table t
(
data varchar(100)
);
I want to create an index to be able to do the following efficiently:
select * from t where contains('%abc%');
And this:
select * from t where contains('abc%');
I also want this table to be updated live.
How do I create such an index? (I have a feeling I need a ctxcat index, but I’m confused about what options I need to give it)
I’m using Oracle 10g.
I would use this (set you min and max length to appropiate values)
The parameters are explained here Oracle Text Reference
and see this question on how to manage the refresh and how the index may not be quicker than a full scan with high cardinality data:
PL/SQL Performance Tuning for LIKE '%…%' Wildcard Queries