2018-09-25 16:46:08 -04:00
|
|
|
-- Create building indexes after bulk loading
|
|
|
|
|
2018-09-30 11:17:11 -04:00
|
|
|
-- Building index over UPRNs (given a building, find UPRNs)
|
2018-10-02 16:12:46 -04:00
|
|
|
CREATE INDEX IF NOT EXISTS uprn_building_idx ON building_properties ( building_id );
|
2018-09-30 11:17:11 -04:00
|
|
|
|
|
|
|
-- UPRN index (given a UPRN, find buildings or parents)
|
2018-10-02 16:12:46 -04:00
|
|
|
CREATE INDEX IF NOT EXISTS uprn_uprn_idx ON building_properties ( uprn );
|
2018-09-30 11:17:11 -04:00
|
|
|
|
|
|
|
-- Parent index over UPRNs (given a UPRN, find children)
|
2018-10-02 16:12:46 -04:00
|
|
|
CREATE INDEX IF NOT EXISTS uprn_parent_idx ON building_properties ( parent_uprn );
|
2018-09-29 13:13:34 -04:00
|
|
|
|
|
|
|
-- TOID index over buildings
|
2018-10-02 16:12:46 -04:00
|
|
|
CREATE INDEX IF NOT EXISTS building_toid_idx ON buildings ( ref_toid );
|