Skip to content

Commit

Permalink
Fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Betts committed Jun 15, 2023
1 parent f898379 commit 0b6e343
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
DROP VIEW IF EXISTS report.group_bubble_type_counts CASCADE;
DROP VIEW IF EXISTS report.group_bubbled_type_counts CASCADE;

-- A weekly count of annotation type, but with counts summed
-- up and down between parents and children as appropriate.

CREATE MATERIALIZED VIEW report.group_bubble_type_counts AS (
CREATE MATERIALIZED VIEW report.group_bubbled_type_counts AS (
SELECT
created_week,
group_to_group.parent_id AS group_id,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
DROP INDEX IF EXISTS report.group_bubbled_activity_created_week_group_id_idx;
DROP INDEX IF EXISTS report.group_bubbled_type_count_created_week_group_id_idx;

REFRESH MATERIALIZED VIEW report.group_bubbled_activity;
REFRESH MATERIALIZED VIEW report.group_bubbled_type_count;

ANALYSE report.group_bubbled_activity;
ANALYSE report.group_bubbled_type_count;

-- A unique index is mandatory for concurrent updates used in the refresh
CREATE UNIQUE INDEX group_bubbled_activity_created_week_group_id_idx ON report.group_bubbled_activity (created_week, group_id);
CREATE UNIQUE INDEX group_bubbled_type_count_created_week_group_id_idx
ON report.group_bubbled_type_count (created_week, group_id, sub_type, shared);

0 comments on commit 0b6e343

Please sign in to comment.