Add timers to trigger function (#1006)
Add timer to all trigger refresh functions to help point where the time is spend on update.
This commit is contained in:
@@ -81,6 +81,8 @@ $$ LANGUAGE plpgsql;
|
||||
|
||||
CREATE OR REPLACE FUNCTION place_city.refresh() RETURNS trigger AS
|
||||
$$
|
||||
DECLARE
|
||||
t TIMESTAMP WITH TIME ZONE := clock_timestamp();
|
||||
BEGIN
|
||||
RAISE LOG 'Refresh place_city rank';
|
||||
PERFORM update_osm_city_point(false);
|
||||
@@ -88,6 +90,8 @@ BEGIN
|
||||
DELETE FROM place_city.osm_ids;
|
||||
-- noinspection SqlWithoutWhere
|
||||
DELETE FROM place_city.updates;
|
||||
|
||||
RAISE LOG 'Refresh place_city done in %', age(clock_timestamp(), t);
|
||||
RETURN NULL;
|
||||
END;
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
@@ -51,6 +51,8 @@ $$ LANGUAGE plpgsql;
|
||||
|
||||
CREATE OR REPLACE FUNCTION place_continent_point.refresh() RETURNS trigger AS
|
||||
$$
|
||||
DECLARE
|
||||
t TIMESTAMP WITH TIME ZONE := clock_timestamp();
|
||||
BEGIN
|
||||
RAISE LOG 'Refresh place_continent_point';
|
||||
PERFORM update_osm_continent_point(false);
|
||||
@@ -58,6 +60,8 @@ BEGIN
|
||||
DELETE FROM place_continent_point.osm_ids;
|
||||
-- noinspection SqlWithoutWhere
|
||||
DELETE FROM place_continent_point.updates;
|
||||
|
||||
RAISE LOG 'Refresh place_continent_point done in %', age(clock_timestamp(), t);
|
||||
RETURN NULL;
|
||||
END;
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
@@ -130,6 +130,8 @@ $$ LANGUAGE plpgsql;
|
||||
|
||||
CREATE OR REPLACE FUNCTION place_country.refresh() RETURNS trigger AS
|
||||
$$
|
||||
DECLARE
|
||||
t TIMESTAMP WITH TIME ZONE := clock_timestamp();
|
||||
BEGIN
|
||||
RAISE LOG 'Refresh place_country rank';
|
||||
PERFORM update_osm_country_point(false);
|
||||
@@ -137,6 +139,8 @@ BEGIN
|
||||
DELETE FROM place_country.osm_ids;
|
||||
-- noinspection SqlWithoutWhere
|
||||
DELETE FROM place_country.updates;
|
||||
|
||||
RAISE LOG 'Refresh place_country done in %', age(clock_timestamp(), t);
|
||||
RETURN NULL;
|
||||
END;
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
@@ -51,6 +51,8 @@ $$ LANGUAGE plpgsql;
|
||||
|
||||
CREATE OR REPLACE FUNCTION place_island_point.refresh() RETURNS trigger AS
|
||||
$$
|
||||
DECLARE
|
||||
t TIMESTAMP WITH TIME ZONE := clock_timestamp();
|
||||
BEGIN
|
||||
RAISE LOG 'Refresh place_island_point';
|
||||
PERFORM update_osm_island_point(false);
|
||||
@@ -58,6 +60,8 @@ BEGIN
|
||||
DELETE FROM place_island_point.osm_ids;
|
||||
-- noinspection SqlWithoutWhere
|
||||
DELETE FROM place_island_point.updates;
|
||||
|
||||
RAISE LOG 'Refresh place_island_point done in %', age(clock_timestamp(), t);
|
||||
RETURN NULL;
|
||||
END;
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
@@ -57,6 +57,8 @@ $$ LANGUAGE plpgsql;
|
||||
|
||||
CREATE OR REPLACE FUNCTION place_island_polygon.refresh() RETURNS trigger AS
|
||||
$$
|
||||
DECLARE
|
||||
t TIMESTAMP WITH TIME ZONE := clock_timestamp();
|
||||
BEGIN
|
||||
RAISE LOG 'Refresh place_island_polygon';
|
||||
PERFORM update_osm_island_polygon(false);
|
||||
@@ -64,6 +66,8 @@ BEGIN
|
||||
DELETE FROM place_island_polygon.osm_ids;
|
||||
-- noinspection SqlWithoutWhere
|
||||
DELETE FROM place_island_polygon.updates;
|
||||
|
||||
RAISE LOG 'Refresh place_island_polygon done in %', age(clock_timestamp(), t);
|
||||
RETURN NULL;
|
||||
END;
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
@@ -92,6 +92,8 @@ $$ LANGUAGE plpgsql;
|
||||
|
||||
CREATE OR REPLACE FUNCTION place_state.refresh() RETURNS trigger AS
|
||||
$$
|
||||
DECLARE
|
||||
t TIMESTAMP WITH TIME ZONE := clock_timestamp();
|
||||
BEGIN
|
||||
RAISE LOG 'Refresh place_state rank';
|
||||
PERFORM update_osm_state_point(false);
|
||||
@@ -99,6 +101,8 @@ BEGIN
|
||||
DELETE FROM place_state.osm_ids;
|
||||
-- noinspection SqlWithoutWhere
|
||||
DELETE FROM place_state.updates;
|
||||
|
||||
RAISE LOG 'Refresh place_state done in %', age(clock_timestamp(), t);
|
||||
RETURN NULL;
|
||||
END;
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
Reference in New Issue
Block a user