 
 
 --
+-- Name: mhra_all_hits; Type: MATERIALIZED VIEW; Schema: public; Owner: -; Tablespace: 
+--
+
+CREATE MATERIALIZED VIEW mhra_all_hits AS
+ SELECT hits.path,
+    sum(hits.count) AS count,
+    hits.http_status,
+    min(hits.mapping_id) AS mapping_id,
+    min(hits.host_id) AS host_id
+   FROM (hits
+     JOIN hosts ON ((hits.host_id = hosts.id)))
+  WHERE (hosts.site_id = 447)
+  GROUP BY hits.path, hits.http_status
+  ORDER BY sum(hits.count) DESC
+  WITH NO DATA;
+
+
+--
+-- Name: ofsted_all_hits; Type: MATERIALIZED VIEW; Schema: public; Owner: -; Tablespace: 
+--
+
+CREATE MATERIALIZED VIEW ofsted_all_hits AS
+ SELECT hits.path,
+    sum(hits.count) AS count,
+    hits.http_status,
+    min(hits.mapping_id) AS mapping_id,
+    min(hits.host_id) AS host_id
+   FROM (hits
+     JOIN hosts ON ((hits.host_id = hosts.id)))
+  WHERE (hosts.site_id = 403)
+  GROUP BY hits.path, hits.http_status
+  ORDER BY sum(hits.count) DESC
+  WITH NO DATA;
+
+
+--
 -- Name: organisational_relationships; Type: TABLE; Schema: public; Owner: -; Tablespace: 
 --
 

    ga_profile_id character varying(16) DEFAULT NULL::character varying,
    whitehall_slug character varying(255) DEFAULT NULL::character varying,
    whitehall_type character varying(255) DEFAULT NULL::character varying,
    abbreviation character varying(255) DEFAULT NULL::character varying
);



    count integer,
    hit_on date
);


--
