Overv / openstreetmap-tile-server

Docker file for a minimal effort OpenStreetMap tile server
Apache License 2.0
1.2k stars 482 forks source link

During the data import, will it be possible to create the indexes in parallel rather than sequencially? #398

Open ghevge opened 11 months ago

ghevge commented 11 months ago

Looking at the run.sh definition. it seems that the indexes creation is done by passing the indexes creation queries in a single script. https://github.com/Overv/openstreetmap-tile-server/blob/master/run.sh#L115

This will generatly result in the sequencial indexes creation at the postgres level.

Starting with postgres 11, there is support available for parallel index creation.

Will this be feasable in openstreetmap-tile-server project context ?

Thanks

Istador commented 11 months ago

With postgresql 11 parallel index creation is enabled by default, so there's no need to change anything.

To fine tune it you might want to change the default max_parallel_maintenance_workers value of 2 (meaning two additional threads, for a total of 3) for larger imports in the postgresql.conf though.

As far as I understand it, this feature is using multiple threads indexing the same bigger table and not indexing different tables at the same time.