[pgrouting-users] RAM needed by 'shortest' for planet database

Stephen Woodbridge woodbri at swoodbridge.com
Mon Feb 25 05:41:39 PST 2013


On 2/25/2013 4:22 AM, Tao Romera Martinez wrote:
> Hello,
>
> I am trying to run 'shortest' on a DB with the routing network of the
> whole planet. I have indices for the id, source, target and geom
> columns, and apply a window to limit the data I pass to 'shortest'.
> However, the postgres server crashes unless the source and target
> nodes are very close.
>
> I suspect the problem may come from a lack of RAM since the server
> only has 1GB, but still have not looked deeper into it. Has anyone
> put a server running with the whole planet routing network and
> experienced the same problem? How much memory is needed?

Yes, this sounds like a reason conclusion. pgRouting has to build a 
graph in memory before it can solve it so loading very large numbers of 
vectors into a graph will use a lot of memory. We use the Boost library 
to build and solve the graph and it does not have any support for paging 
data into memory as it is needed. Actually none of the other algorithms 
have that support either.

You might try something like:

select edges from streets where near the startpoint
union
select edges from streets where near the endpoint
union
select edges from streets where highway only

The idea here is to select all edges near the start and end points, 
where "near" is a large enough radius to get you into the major roads 
part of the network, and to only select the major roads network for the 
rest of the graph. This would eliminate millions of neighborhood streets 
that you don't car about.

Turn the above into a query and pass that to you solution.

-Steve


More information about the Pgrouting-users mailing list