Cheat Sheet

Tuesday, June 7, 2016

tsvector update table dan create index

Update table menggunakan tsvector
UPDATE table SET (col1_keywords, col2_keywords, col3_keywords) = (to_tsvector(col1), to_tsvector(col1 || ' ' || col2), to_tsvector(col1 || ' ' || col2 || ' ' || col3))
Kemudian, create index untuk column keyword tersebut.
CREATE INDEX namadma_dun_par_idx ON daerahmengundifull USING gin(namadma_dun_par_keywords)

No comments:

Post a Comment