switch postcode tokens to new word table layout

This commit is contained in:
Sarah Hoffmann
2021-07-20 12:11:12 +02:00
parent 5ab0a63fd6
commit 5394b1fa1b
3 changed files with 26 additions and 17 deletions

View File

@@ -10,7 +10,12 @@ CREATE INDEX idx_word_word_token ON word
USING BTREE (word_token) {{db.tablespace.search_index}};
-- Used when updating country names from the boundary relation.
CREATE INDEX idx_word_country_names ON word
USING btree((info->>'cc')) WHERE type = 'C';
USING btree((info->>'cc')) {{db.tablespace.address_index}}
WHERE type = 'C';
-- Used when inserting new postcodes on updates.
CREATE INDEX idx_word_postcodes ON word
USING btree((info->>'postcode')) {{db.tablespace.address_index}}
WHERE type = 'P'
GRANT SELECT ON word TO "{{config.DATABASE_WEBUSER}}";
DROP SEQUENCE IF EXISTS seq_word;