-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e46d2f2
commit 93b51dc
Showing
1 changed file
with
42 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
-- Table: gwolofs.congestion_raw_segments | ||
|
||
-- DROP TABLE IF EXISTS gwolofs.congestion_raw_segments; | ||
|
||
CREATE TABLE IF NOT EXISTS gwolofs.congestion_raw_segments | ||
( | ||
time_grp timestamp without time zone NOT NULL, | ||
segment_id integer NOT NULL, | ||
bin_range tsrange NOT NULL, | ||
dt_start timestamp without time zone, | ||
dt_end timestamp without time zone, | ||
tt numeric, | ||
unadjusted_tt numeric, | ||
total_length numeric, | ||
length_w_data numeric, | ||
num_obs integer, | ||
CONSTRAINT dynamic_bins_unique EXCLUDE USING gist ( | ||
segment_id WITH =, | ||
bin_range WITH &&, | ||
time_grp WITH = | ||
) | ||
) | ||
|
||
TABLESPACE pg_default; | ||
|
||
ALTER TABLE IF EXISTS gwolofs.congestion_raw_segments | ||
OWNER TO gwolofs; | ||
|
||
REVOKE ALL ON TABLE gwolofs.congestion_raw_segments FROM bdit_humans; | ||
|
||
GRANT SELECT ON TABLE gwolofs.congestion_raw_segments TO bdit_humans; | ||
|
||
GRANT ALL ON TABLE gwolofs.congestion_raw_segments TO gwolofs; | ||
-- Index: dynamic_bin_idx | ||
|
||
-- DROP INDEX IF EXISTS gwolofs.dynamic_bin_idx; | ||
|
||
CREATE INDEX IF NOT EXISTS dynamic_bin_idx | ||
ON gwolofs.congestion_raw_segments USING btree | ||
(segment_id ASC NULLS LAST, time_grp ASC NULLS LAST) | ||
WITH (deduplicate_items=True) | ||
TABLESPACE pg_default; |