1 DROP TABLE IF EXISTS word_frequencies;
2 CREATE TABLE word_frequencies AS
3 SELECT unnest(name_vector) as id, count(*) FROM search_name GROUP BY id;
5 CREATE INDEX idx_word_frequencies ON word_frequencies(id);
7 UPDATE word SET search_name_count = count
9 WHERE word_token like ' %' and word_id = id;
11 DROP TABLE word_frequencies;