Project

General

Profile

« Previous | Next » 

Revision 8111

inputs/FIA/*/postprocess.sql: Cluster tables by their *.unique index for faster joins

View differences:

inputs/FIA/PLOT/postprocess.sql
15 15
]::functions.col_cast[]);
16 16

  
17 17
SELECT functions.create_if_not_exists($$ALTER TABLE "PLOT" ADD CONSTRAINT "PLOT.unique" UNIQUE (".STATECD", ".UNITCD", ".COUNTYCD", ".PLOT", ".INVYR")$$);
18
SELECT functions.cluster_once(:table_str, '"PLOT.unique"');
inputs/FIA/COND/postprocess.sql
33 33
$$);
34 34

  
35 35
SELECT functions.create_if_not_exists($$ALTER TABLE "COND" ADD CONSTRAINT "COND.unique" UNIQUE (".STATECD", ".UNITCD", ".COUNTYCD", ".PLOT", ".INVYR", ".CONDID")$$);
36
SELECT functions.cluster_once(:table_str, '"COND.unique"');
inputs/FIA/TREE/postprocess.sql
22 22

  
23 23
-- ("STATECD", "UNITCD", "COUNTYCD", "PLOT", "INVYR", "CONDID", "SUBP", "TREE", "STATUSCD") is not unique
24 24
SELECT functions.create_if_not_exists($$ALTER TABLE "TREE" ADD CONSTRAINT "TREE.unique" UNIQUE ("TREE.CN")$$);
25
SELECT functions.cluster_once(:table_str, '"TREE.unique"');
25 26

  
26 27
SELECT functions.create_if_not_exists($$CREATE INDEX "TREE.parent" ON "TREE" (".STATECD", ".UNITCD", ".COUNTYCD", ".PLOT", ".INVYR", ".CONDID", ".SUBP")$$);
inputs/FIA/SUBPLOT/postprocess.sql
17 17
]::functions.col_cast[]);
18 18

  
19 19
SELECT functions.create_if_not_exists($$ALTER TABLE "SUBPLOT" ADD CONSTRAINT "SUBPLOT.unique" UNIQUE (".STATECD", ".UNITCD", ".COUNTYCD", ".PLOT", ".INVYR", ".SUBP")$$);
20
SELECT functions.cluster_once(:table_str, '"SUBPLOT.unique"');

Also available in: Unified diff