-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finalized db table changes. And service updates accordingly.
- Loading branch information
1 parent
1d8b0b2
commit e11eb68
Showing
10 changed files
with
99 additions
and
58 deletions.
There are no files selected for viewing
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,26 +1,34 @@ | ||
CREATE TABLE IF NOT EXISTS euw1.match | ||
( | ||
match_id BIGINT PRIMARY KEY, | ||
queue SMALLINT, | ||
timestamp TIMESTAMP, | ||
duration SMALLINT DEFAULT NULL, | ||
win BOOLEAN DEFAULT NULL, -- False: Blue | True: Red | ||
details JSON, | ||
timeline JSON, | ||
roleml JSON | ||
match_id BIGINT PRIMARY KEY, | ||
queue SMALLINT, | ||
timestamp TIMESTAMP, | ||
details_pulled BOOLEAN, | ||
timeline_pulled BOOLEAN | ||
); | ||
-- General lookups | ||
CREATE INDEX ON euw1.match ((timestamp::date), queue); | ||
-- Lookup for undone tasks | ||
-- This will only be used if most data in the table is not null, | ||
-- so to use it data older than your minimum match_details age should be removed | ||
-- see https://stackoverflow.com/questions/5203755/why-does-postgresql-perform-sequential-scan-on-indexed-column | ||
CREATE INDEX ON euw1.match ((details_pulled IS NULL)); | ||
CREATE INDEX ON euw1.match ((timeline_pulled IS NULL)); | ||
|
||
|
||
/* | ||
CREATE TABLE IF NOT EXISTS kr.match | ||
CREATE TABLE IF NOT EXISTS euw1.match_data | ||
( | ||
match_id BIGINT PRIMARY KEY, | ||
queue SMALLINT, | ||
timestamp TIMESTAMP, | ||
duration SMALLINT DEFAULT NULL, | ||
win BOOLEAN DEFAULT NULL, -- False: Blue | True: Red | ||
details_pulled BOOLEAN, | ||
timeline_pulled BOOLEAN | ||
win BOOLEAN DEFAULT NULL, | ||
details JSONB, -- If you want to reduce space required use JSON instead of JSONB | ||
timeline JSONB, | ||
roleml JSONB | ||
); | ||
*/ | ||
-- General lookups | ||
CREATE INDEX ON euw1.match_data ((timestamp::date), queue, duration, win); | ||
-- Ready for roleml index | ||
CREATE INDEX ON euw1.match_data ((details IS NOT NULL AND timeline IS NOT NULL AND roleml IS NULL)); | ||
-- Find finished roleml | ||
CREATE INDEX ON euw1.match_data ((roleml IS NOT NULL)); |
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
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
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
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
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
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
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
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
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