-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Index for high_road SQL? #5
Comments
The query uses the function CREATE INDEX planet_osm_line_highroad_z10 ON planet_osm_line USING gist(way) WHERE highway IN ('motorway', 'trunk', 'primary', 'secondary', 'tertiary'); Does this help? To be honest, when I modified the Toner style to be useable with an Osm2pgsql database, I just tried to get it working. Performance was not critical. If you want to help, I suggest to replace the usage of to the |
Thanks for quick reply and for the work you've done! Will try, but Postg is not my preferred database, I worked with MySQL so I am trying to catch up and learn this new environment. I am not sure what "normal" speed of generating tiles should be, I see some taking 0,2 seconds, I guess thats tiles from oceans, and some taking up to 10 minutes (on zoom 10), tiles are generated 8x8 at a time
the hardware should be sufficient, the db is on array of disks, indexes on PCI SSD card, 2xcpu each 12 threads, 128Gb RAM |
It becomes a bit off-topic here but I will answer it nevertheless. Tiles up to zoom level 12 are usually pre-rendered at setup. Therefore, their rendering performance is not that important. Performance is important at zoom level >= 13 when they are rendered live while the client is waiting for their request to be answered if the tile is not available in the cache. Ten minutes is a bit long at zoom level 10 but you will have difficulties to get it below one minute.
Mind that the whole database should be on SSD/NVMe storage. Just having parts (tablespace or indexes only) on fast storage is not sufficient. I suggest to mount /var/lib/postgresql (or wherever your distribution's database directory is) from fast storage (or symlink it). |
the index you suggested did indeed help! the time for that above mentioned explain fell down from Execution Time: 172915.863 ms which makes quite a difference :) I will add another index for the z11 as there are more values in the highway filter and probably one more for z15+ as there is also a railway in it I'm aware for the need of SSD for the whole postgres DB, but I simply dont have so much space, the whole planet import took more than I expected :( so I created tablespaces for the indexes at least, and will add more SSDs to the server in the future to move the db there. Thank you for the reference times, it is hard to get the idea what is "normal" when doing this for the first time :) |
Hi, I use your toner style mixed into the openstreetmap-carto docker, with good success, but I realised I'm missing some indexes, as the function high_road calls are running very slow (on zoom 10 it may take minutes, sometimes more to finish the query). EXPLAIN command is not usefull at all in this case, as it is a function.
Can you help recommend what kind of indexes on tables might help to speed up these calls? Thank you
The text was updated successfully, but these errors were encountered: