-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jon Betts
committed
Jun 15, 2023
1 parent
f898379
commit 0b6e343
Showing
2 changed files
with
7 additions
and
6 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
...from_scratch/04_activity_counts/01_groups/05_group_bubbled_type_counts/01_create_view.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 5 additions & 4 deletions
9
...rom_scratch/04_activity_counts/01_groups/05_group_bubbled_type_counts/02_initial_fill.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |