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:
@@ -70,6 +70,8 @@ $$ LANGUAGE plpgsql;
|
||||
|
||||
CREATE OR REPLACE FUNCTION poi_point.refresh() RETURNS trigger AS
|
||||
$$
|
||||
DECLARE
|
||||
t TIMESTAMP WITH TIME ZONE := clock_timestamp();
|
||||
BEGIN
|
||||
RAISE LOG 'Refresh poi_point';
|
||||
PERFORM update_osm_poi_point();
|
||||
@@ -78,6 +80,8 @@ BEGIN
|
||||
PERFORM update_osm_poi_point_agg();
|
||||
-- noinspection SqlWithoutWhere
|
||||
DELETE FROM poi_point.updates;
|
||||
|
||||
RAISE LOG 'Refresh poi_point done in %', age(clock_timestamp(), t);
|
||||
RETURN NULL;
|
||||
END;
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
@@ -75,6 +75,8 @@ $$ LANGUAGE plpgsql;
|
||||
|
||||
CREATE OR REPLACE FUNCTION poi_polygon.refresh() RETURNS trigger AS
|
||||
$$
|
||||
DECLARE
|
||||
t TIMESTAMP WITH TIME ZONE := clock_timestamp();
|
||||
BEGIN
|
||||
RAISE LOG 'Refresh poi_polygon';
|
||||
PERFORM update_poi_polygon(false);
|
||||
@@ -82,6 +84,8 @@ BEGIN
|
||||
DELETE FROM poi_polygon.osm_ids;
|
||||
-- noinspection SqlWithoutWhere
|
||||
DELETE FROM poi_polygon.updates;
|
||||
|
||||
RAISE LOG 'Refresh poi_polygon done in %', age(clock_timestamp(), t);
|
||||
RETURN NULL;
|
||||
END;
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
Reference in New Issue
Block a user