Noop: tag sql MAT VIEWS with a special comment (#733)

Tag all SQL materialized views with a machine-readable comment
to indicate that this materialized view can be created without
data:

   /* DELAY_MATERIALIZED_VIEW_CREATION */

In the next version of tools this comment can be optionally
replaced with the "WITH NO DATA" parameter, thus allowing
a much faster execution of the SQL script. All materialized
viewes will be populated with data in parallel afterwards
using the `refresh-views` tools script.
This commit is contained in:
Yuri Astrakhan
2020-01-20 12:02:49 -05:00
committed by GitHub
parent 4e13a17e1a
commit 1d91b9ef6e
6 changed files with 21 additions and 21 deletions

View File

@@ -13,7 +13,7 @@ CREATE MATERIALIZED VIEW osm_poi_stop_centroid AS (
uic_ref
HAVING
count(*) > 1
);
) /* DELAY_MATERIALIZED_VIEW_CREATION */;
DROP MATERIALIZED VIEW IF EXISTS osm_poi_stop_rank CASCADE;
CREATE MATERIALIZED VIEW osm_poi_stop_rank AS (
@@ -33,7 +33,7 @@ CREATE MATERIALIZED VIEW osm_poi_stop_rank AS (
WHERE
subclass IN ('bus_stop', 'bus_station', 'tram_stop', 'subway')
ORDER BY p.uic_ref, rk
);
) /* DELAY_MATERIALIZED_VIEW_CREATION */;
ALTER TABLE osm_poi_point ADD COLUMN IF NOT EXISTS agg_stop INTEGER DEFAULT NULL;
SELECT update_osm_poi_point_agg();
SELECT update_osm_poi_point_agg();