3 create materialized
view if not exists context_node_ngrams_view
as
4 select context_node_ngrams.context_id
, ngrams_id
, nodes_contexts.node_id
6 join context_node_ngrams
7 on context_node_ngrams.context_id
= nodes_contexts.context_id
;
9 create index if not exists context_node_ngrams_context_id_ngrams_id_idx
on context_node_ngrams(context_id
, ngrams_id
);
10 create index if not exists context_node_ngrams_view_context_id_idx
on context_node_ngrams_view(context_id
);
11 create index if not exists context_node_ngrams_view_ngrams_id_idx
on context_node_ngrams_view(ngrams_id
);
12 create index if not exists context_node_ngrams_view_node_id_idx
on context_node_ngrams_view(node_id
);
13 create index if not exists node_stories_ngrams_id_idx
on node_stories(ngrams_id
);