Check out example codes for "increase speed of like queries postgres". It will help you in understanding the concepts better.

Code Example 1

CREATE INDEX tbl_col_gin_trgm_idx  ON tbl USING gin  (col gin_trgm_ops);

Learn ReactJs, React Native from akashmittal.com