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:
Frédéric Rodrigo
2020-10-08 15:57:16 +02:00
committed by GitHub
parent e8bf4aa94a
commit 36b7533d3b
16 changed files with 68 additions and 1 deletions

View File

@@ -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;