Searching a large string in Database

374 views Asked by At

So I have a table in which one of the columns is used to store data of type string which usually has 10000 characters. When trying to match a particular string it takes a lot of time operationally. Is there any way to reduce it ??

1

There are 1 answers

0
SXN On

if you need to optimize select query like this

select *
from tbl
where field_code ilike '%text%'

use gin index

more info here https://hashrocket.com/blog/posts/exploring-postgres-gin-index