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)
|
|
|
|
CREATE INDEX uprn_building_idx ON building_properties ( building_id );
|
|
|
|
|
|
|
|
-- UPRN index (given a UPRN, find buildings or parents)
|
|
|
|
CREATE INDEX uprn_uprn_idx ON building_properties ( uprn );
|
|
|
|
|
|
|
|
-- Parent index over UPRNs (given a UPRN, find children)
|
|
|
|
CREATE INDEX uprn_parent_idx ON building_properties ( parent_uprn );
|
2018-09-29 13:13:34 -04:00
|
|
|
|
|
|
|
-- TOID index over buildings
|
|
|
|
CREATE INDEX building_toid_idx ON buildings ( ref_toid );
|