   USING btree
   ((sample & B'00001'::"bit"));
 
-ALTER TABLE s_facts ALTER node_anno SET STATISTICS 1000;
+ALTER TABLE s_facts ALTER node_anno SET STATISTICS 2000;
 
 VACUUM ANALYZE s_facts;
 VACUUM ANALYZE s_node_anno;
"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);

-- copy and adjust facts table
CREATE TABLE s_facts (

  namespace varchar(150),
  "name" varchar(150),
  val varchar(1500),
  occurences bigint,
  UNIQUE(namespace, "name", val)
);

INSERT INTO s_node_anno(namespace, "name", val, occurences)
(
  SELECT node_annotation_namespace, node_annotation_name, node_annotation_value, count(*) as occurences
  FROM facts_2014 
  WHERE (sample & B'01000') = B'01000'
  GROUP BY node_annotation_namespace, node_annotation_name, node_annotation_value
);

-- indexes on node annotations
