 "name" varchar_pattern_ops, val varchar_pattern_ops);
 CREATE INDEX idx_s_node_anno_namespace ON s_node_anno (
 namespace varchar_pattern_ops, "name" varchar_pattern_ops, val varchar_pattern_ops);
+CREATE INDEX idx_s_node_anno_occurences ON s_node_anno (occurences);
 
 -- copy and adjust facts table
 CREATE TABLE s_facts (

    edge_namespace,
    edge_name,
    (SELECT id FROM s_node_anno AS na 
      WHERE na.namespace = node_annotation_namespace ů
        AND na.name = node_annotation_name
        AND na.val = node_annotation_value
    ),

  USING btree
  ((sample & B'00001'::"bit"));

ALTER TABLE s_facts ALTER node_anno SET STATISTICS 2000;

VACUUM ANALYZE s_facts;
VACUUM ANALYZE s_node_anno;