[OSM-dev] Identification of "bottleneck" SQL code

SteveC steve at asklater.com
Tue Apr 11 01:18:06 BST 2006

* @ 10/04/06 10:44:55 PM nick at hogweed.org wrote:
> In case anyone is interested, I have identified some "bottleneck" SQL code. I 
> also have a question about the current slippy map.
> I have now added *all* UK OSM data into the database used by the test map 
> drawing client at http://nick.dev.openstreetmap.org/index.php. This causes a 
> huge slowdown, to unusably slow on the dev server. Upon testing the biggest 
> bottleneck is the SQL which deals with ways.

Yes, it's been updated but not checked in yet. And the schema won't have
the right indexes on it either.

> Incidentally, how does the current OSM slippy map deal with segments which 
> cross a tile but have no nodes within? It appears to do it, as there are no 

it doesn't get them, so it doesn't draw them.

> 'broken' segments, but taking a glance at the code I can't see how. It calls 
> the API to grab nodes and segments, but the API code has no special SQL to 
> deal with this: all it does is grab nodes within the bounding box and 
> segments connecting the nodes.

the drawing code then gets nodes that are part of segs but not in the
bounding box. You can find tiles where lines should but dont go through
them. The simplest fix is to make a minimum path length and then select
a bounding box which includes your box plus that length.

have fun,

SteveC steve at asklater.com http://www.asklater.com/steve/

More information about the dev mailing list