15 Commits

Author SHA1 Message Date
Frédéric Rodrigo
36b7533d3b
Add timers to trigger function (#1006)
Add timer to all trigger refresh functions to help point where the time is spend on update.
2020-10-08 16:57:16 +03:00
Eva Jelinkova
f7d7a0ced3
Housenumbers - diff update, multipolygons (#990)
Following https://github.com/openmaptiles/openmaptiles/pull/983 - removing points also on multipolygons and checking only new geometry when updated.
2020-09-21 14:47:55 +03:00
Taro Matsuzawa aka. btm
1685eaccbd
#766 remove housenumbers inside polygon and same number (#983) 2020-09-16 17:06:48 +02:00
Frédéric Rodrigo
bb2a4328f3
Make more simple incremental update (#944)
Replacing update on the whole table with an update only on changed rows.

The goal is to update more quickly by just updating the changing content.
The update now focus on osm_id of changed rows, it use index. Add a where clause tags != update_tags(tags, geometry) en ensure only update when changed.

It requires one more trigger and a table to store changed osm_id.

The UPDATE is keep in a function to be reusable for initial setup and trigger update.

I try many code layout before done it in this way with the goal to keep the code for initial pass and for update. It should have low impact on initial data load. Better performance for row update can be achieve with BEFORE UPDATE, but require to duplicate the logic.

It is not based on the already merged https://github.com/openmaptiles/openmaptiles/pull/896 because calling and update within a function for each updated row was not efficient for larger table (like housenumber).

It addresses #814.


* Remake update_peak_point use incremental update #814

* Make update_aerodrome_label_point use incremental update #814

* Make housenumber_centroid use incremental update #814

* Make update_continent_point use incremental update #814

* Make update_island_point use incremental update #814

* Make update_island_polygon use incremental update #814

* Remove dead code in update_state_point.sql

* Make update_state_point use incremental update #814

* Remove dead code in update_country_point.sql

* Make update_country_point use incremental update #814

* Make osm_poi_polygon use incremental update #814

Thanks @frodrigo
2020-08-28 11:03:27 +02:00
Frédéric Rodrigo
9bb17792a6
Remove alignment of AS in SQL and few others (#932)
* Remove alignment of AS in SQL

* Remove alignment of CREATE TABLE in SQL
2020-07-22 13:48:25 +02:00
Yuri Astrakhan
6457419e0d
NOOP: Format all layer's SQL code (#917)
I would like to reformat all of our SQL to have a concise coding style.
This makes it far easier to understand the code for a casual contributor,
and lets us spot errors more easily.

Most importantly, it makes it much easier to grep (search) the code because it is more likely to be in the same syntax

Some key changes:
* SQL keywords are always UPPERCASE, e.g. `SELECT WHEN AS END ...`
* types, variables, aliases, and field names (identifiers) are always lower case
* `LANGUAGE 'plpgsql'` is now `LANGUAGE plpgsql` (no quotes)
* a few minor spacing/semicolon cleanups

P.S. Per @TomPohys request, `TABLE` is spelled using upper case despite being a type for consistency with PG Docs. Same for `LANGUAGE SQL` vs `LANGUAGE plpgsql`.
2020-06-08 12:19:55 -04:00
Yuri Astrakhan
8fe9af2327
Minor trailing whitespace cleanup (#596)
Remove extra spaces in a number of files.
2019-03-29 17:15:42 -04:00
Eduard Popov
0a26d2be99 Housenumber and POI calc optimisation (#247)
Using NPoints(Centroid) = NPoints, thanks edpop
2017-05-21 21:01:31 -04:00
stirringhalo
153976735f ST_PointOnSurface instead of topoint 2017-01-17 09:03:40 -05:00
stirringhalo
cda3af9215 Change SELECT to PERFORM in function and drop triggers first 2017-01-06 20:33:43 -05:00
stirringhalo
b58d80ce44 Make housenumber rerunnable 2017-01-05 14:39:04 -05:00
stirringhalo
8b4777fd79 poi and housenumber triggers 2017-01-04 17:54:15 -05:00
stirringhalo
b97e5ad9fb Convert housenumber point conversion to function 2017-01-04 17:40:59 -05:00
ImreSamu
63cdc3362d add etldoc to layer_housenumber 2016-11-10 01:11:11 +01:00
lukasmartinelli
4c85fd787e Add layer housenumber 2016-10-25 19:16:18 +02:00