Skip to content

Commit

Permalink
indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
levkk committed Oct 29, 2024
1 parent 8654afc commit 8f2a2dc
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(path, created_at);
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_errors ON rwf_requests USING btree(code) WHERE code >= 400;
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_too_slow ON rwf_requests USING btree(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) WHERE duration >= 1000.0; -- the unit is milliseconds

0 comments on commit 8f2a2dc

Please sign in to comment.