Skip to content

Commit

Permalink
refactor(DB): enhanced top-events caching
Browse files Browse the repository at this point in the history
  • Loading branch information
tahayk committed Aug 8, 2024
1 parent 86f5025 commit 7dc0c05
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion ee/scripts/schema/db/init_dbs/postgresql/1.20.0/1.20.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ CREATE TABLE IF NOT EXISTS or_cache.autocomplete_top_values
result jsonb NULL,
execution_time integer NULL,
created_at timestamp DEFAULT timezone('utc'::text, now()) NOT NULL,
UNIQUE (project_id, event_type, event_key)
UNIQUE NULLS NOT DISTINCT (project_id, event_type, event_key)
);

COMMIT;
Expand Down
4 changes: 1 addition & 3 deletions ee/scripts/schema/db/init_dbs/postgresql/init_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1313,9 +1313,7 @@ CREATE TABLE or_cache.autocomplete_top_values
result jsonb NULL,
execution_time integer NULL,
created_at timestamp DEFAULT timezone('utc'::text, now()) NOT NULL,
UNIQUE (project_id, event_type, event_key)
-- TODO: use `UNIQUE NULLS NOT DISTINCT (project_id, event_type, event_key)`
-- when PG upgrade is validated by devops team
UNIQUE NULLS NOT DISTINCT (project_id, event_type, event_key)
);

COMMIT;
1 change: 0 additions & 1 deletion scripts/helmcharts/openreplay/charts/chalice/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ env:
announcement_url: ''
jwt_secret: "SetARandomStringHere"
jwt_algorithm: HS512
jwt_exp_delta_seconds: '2592000'
# Enable logging for python app
# Ref: https://stackoverflow.com/questions/43969743/logs-in-kubernetes-pod-not-showing-up
PYTHONUNBUFFERED: '0'
Expand Down
1 change: 0 additions & 1 deletion scripts/helmcharts/openreplay/charts/utilities/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ chalice:
announcement_url: ''
jwt_secret: "SetARandomStringHere"
jwt_algorithm: HS512
jwt_exp_delta_seconds: '2592000'
# Enable logging for python app
# Ref: https://stackoverflow.com/questions/43969743/logs-in-kubernetes-pod-not-showing-up
PYTHONUNBUFFERED: '0'
Expand Down
2 changes: 1 addition & 1 deletion scripts/schema/db/init_dbs/postgresql/1.20.0/1.20.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ CREATE TABLE IF NOT EXISTS or_cache.autocomplete_top_values
result jsonb NULL,
execution_time integer NULL,
created_at timestamp DEFAULT timezone('utc'::text, now()) NOT NULL,
UNIQUE (project_id, event_type, event_key)
UNIQUE NULLS NOT DISTINCT (project_id, event_type, event_key)
);

COMMIT;
Expand Down
4 changes: 1 addition & 3 deletions scripts/schema/db/init_dbs/postgresql/init_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1199,9 +1199,7 @@ CREATE TABLE or_cache.autocomplete_top_values
result jsonb NULL,
execution_time integer NULL,
created_at timestamp DEFAULT timezone('utc'::text, now()) NOT NULL,
UNIQUE (project_id, event_type, event_key)
-- TODO: use `UNIQUE NULLS NOT DISTINCT (project_id, event_type, event_key)`
-- when PG upgrade is validated by devops team
UNIQUE NULLS NOT DISTINCT (project_id, event_type, event_key)
);


Expand Down

0 comments on commit 7dc0c05

Please sign in to comment.