-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#66 Add the real parent table structure, previous commit was a functi…
…on to create yearly ones
- Loading branch information
Showing
1 changed file
with
23 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,23 @@ | ||
-- Parent table structure | ||
|
||
CREATE TABLE IF NOT EXISTS congestion.centreline_monthly | ||
( | ||
uid integer NOT NULL, | ||
mth date NOT NULL, | ||
hr integer NOT NULL, | ||
day_type text, | ||
avg_tt numeric NOT NULL, | ||
median_tt numeric NOT NULL, | ||
pct_85_tt numeric NOT NULL, | ||
pct_95_tt numeric NOT NULL, | ||
min_tt numeric NOT NULL, | ||
max_tt numeric NOT NULL, | ||
std_dev numeric NOT NULL, | ||
num_bins integer NOT NULL | ||
) PARTITION BY RANGE (mth); | ||
|
||
ALTER TABLE congestion.centreline_monthly OWNER TO congestion_admins; | ||
GRANT SELECT ON TABLE congestion.centreline_monthly TO bdit_humans; | ||
|
||
COMMENT ON TABLE congestion.centreline_monthly | ||
IS 'Table that contains centreline sets equivalent of network segments hourly travel time and travel time index for each monthly. Partition yearly using mth column. New monthly data automatically aggregated through an airflow process.'; |