   (text_ref);
 
 ----- 2nd query
-CREATE INDEX idx__2nd_query_:id ON facts_:id (text_ref,left_token, right_token);
+CREATE INDEX idx__2nd_query_:id ON facts_:id (corpus_ref, text_ref,left_token, right_token);
 
 -- optimize the select distinct
-CREATE INDEX idx_distinct_helper_:id ON facts_:id(id, text_ref, left_token, right_token);
+CREATE INDEX idx_distinct_helper_:id ON facts_:id(id, corpus_ref, text_ref, left_token, right_token);
 
 -- allow simple searches (node, tok etc)
 CREATE INDEX idx__sample_n__:id ON facts_:id(n_sample);

  USING btree
  (node_anno_ref, corpus_ref);

CREATE INDEX idx__facts_node_anno2__:id
  ON facts_:id
  USING btree
  (node_anno_ref, text_ref);

CREATE INDEX idx__facts_edge_annotation__:id
  ON facts_:id
  USING btree

CREATE INDEX idx__facts_right__:id
  ON facts_:id
  USING btree
  ("right", corpus_ref);


CREATE INDEX idx__facts_right_token__:id
  ON facts_:id
  USING btree
  (right_token, corpus_ref);

CREATE INDEX idx__facts_root__:id
  ON facts_:id
