Skip to content

Commit

Permalink
fix indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
levkk committed Oct 29, 2024
1 parent f882df3 commit e289dc1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rwf/src/model/migrations/bootstrap.sql
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ CREATE TABLE IF NOT EXISTS rwf_requests (
duration REAL NOT NULL
);

CREATE INDEX IF NOT EXISTS rwf_requests_path_created_at ON rwf_requests USING btree(created_at, path);
CREATE INDEX IF NOT EXISTS rwf_requests_path_created_at ON rwf_requests USING btree(created_at, path, client_id);

CREATE INDEX IF NOT EXISTS rwf_requests_errors ON rwf_requests USING btree(created_at, client_id, code) WHERE code >= 400;
CREATE INDEX IF NOT EXISTS rwf_requests_errors ON rwf_requests USING btree(created_at, code, client_id) WHERE code >= 400;

CREATE INDEX IF NOT EXISTS rwf_requests_too_slow ON rwf_requests USING btree(created_at, duration) WHERE duration >= 1000.0; -- the unit is milliseconds
CREATE INDEX IF NOT EXISTS rwf_requests_too_slow ON rwf_requests USING btree(created_at, duration, client_id) WHERE duration >= 1000.0; -- the unit is milliseconds

0 comments on commit e289dc1

Please sign in to comment.