I have CLIENTS_WORDS table with columns: ID, CLIENT_ID, WORD in Postgresql database
ID|CLIENT_ID|WORD
1 |1242 |word1
2 |1242 |WordX.foo
3 |1372 |nextword
4 |1999 |word1
In this table possible about 100k-500k rows.
I have query string like this:
'Some people tell word1 to someone'
'Another stringWordX.foo too possible'
I wish select * from table where WORD column text contains in query string.
Now I use select
select * from CLIENTS_WORDS
where strpos('Some people tell word1 to someone', WORD) > 0
My question, where is the best perfomance/fast way to retrieve matched rows?