CREATE TABLE recipes(
title text,
ingredients text,
directions text,
link text,
source text,
ner text,
site text);
\COPY recipes(title, ingredients, directions, link, source, ner, site)
FROM 'recipes_data.csv' DELIMITER ',' CSV HEADER;
ALTER TABLE recipes ADD search tsvector GENERATED ALWAYS AS
(to_tsvector('english', title) ||
to_tsvector('english', ingredients) ||
to_tsvector('english', directions)) STORED;
ALTER TABLE
Time: 506514.510 ms (08:26.515)
CREATE INDEX idx_recipes_search ON recipes USING GIN(search);
CREATE INDEX
Time: 129500.090 ms (02:09.500)
CREATE INDEX idx_recipes_title ON recipes (title);