Some of the `update_osm_${LAYER}`-functions, which are executed by triggers on updates, execute an UPDATE statement on the same tables that have these triggers. This causes the trigger functions `flag` and `store` to run multiple times for one record.
For instance, if I add log in the trigger functions and run an INSERT on `osm_housenumber_point`, this output is generated:
```
NOTICE: Store
NOTICE: Flag
NOTICE: Refresh housenumber
NOTICE: Flag
NOTICE: Store
NOTICE: Flag
INSERT 0 1
```
If we limit the triggers from executing if they are called from another trigger using `pg_trigger_depth() < 1`, the triggers will only be triggered once per record:
```
NOTICE: Store
NOTICE: Flag
NOTICE: Refresh housenumber
INSERT 0 1
```
This will prevent redunant executions and might improve update performance.
Co-authored-by: Patrik Sylve <patrik.sylve@t-kartor.com>
poi
Docs
Read the layer documentation at http://openmaptiles.org/schema#poi

