Skip to content
This repository has been archived by the owner on Nov 12, 2019. It is now read-only.

Commit

Permalink
Bug 1490379 - Create index for getRequestHealth
Browse files Browse the repository at this point in the history
  • Loading branch information
jhford committed Sep 12, 2018
1 parent 6fb075f commit 8d21c68
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions sql/create-db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ CREATE TABLE IF NOT EXISTS awsrequests (
PRIMARY KEY(region, "requestId")
);

-- This index is needed for requesting recent errors on the very large
-- awsrequests table for the /recent-errors/ and related endpoints
CREATE INDEX ON awsrequests (
region,
az,
Expand All @@ -103,6 +105,18 @@ CREATE INDEX ON awsrequests (
called
) WHERE error=true AND method = 'runInstances';

-- This index is needed for requesting the recent requests health information
-- on the very large awsrequests table for the /health/ and related endpoints
CREATE INDEX ON awsrequests (
region,
az,
"instanceType",
"workerType",
code,
error,
called
) WHERE method = 'runInstances';

-- Cloudwatch Events Log
-- We want to keep a log of when every cloud watch event was generated
CREATE TABLE IF NOT EXISTS cloudwatchlog (
Expand Down

0 comments on commit 8d21c68

Please sign in to comment.