I have downloaded data for india as a dbf file then converted it using osm2po to make it routable but the problem is when i make any routing query it takes a lot of time around 300 seconds and these results are after indexing source, target and id columns. So anyone can please tell how to enhance speed of pgrouting algorithm, or which algorithm should be used, time under 5 seconds would be OK for me, thanks in advance

  • Use search. There are many many same Questions. And usual ways are , limit data amount using bounding box or something similar. Use so big Shared Mem / work mem setting that moust of used routing fits in (not faster i none user scenario) . Use SSD for databse filesystem and fastest is use RAM disk for routing table. – simplexio Mar 7 '14 at 12:07

If you have a normal computer and no SSD or sth. like that you won't get much better results. Using boundingboxes is misleading and sometimes quite wrong. Imagine a C-shaped route - from south Italy to south Greece e.g. osm2po 4.8.8 provides a new feature which I haven't tested with pgRouing but it might help a bit. Read this here to get a first impression what I mean. Enable useQuadTileOrder=true in the osm2po.config file and create the table again. Finally apply the clustering to the source column.

In addition you can cut your table into two pieces. One for the routing itself with columns like source, target, costs, etc. and another one for the geometry reconstruction after the route has been found.

Please report your results here in this thread. THX.


Our RW Net 4 routing algorithms easily beat those timings by a factor 1000 or more, depending upon a number of factors. Making it possible to reach timings well below the desired 5 seconds.


Try A* algorithm. That might satisfy your need

Not the answer you're looking for? Browse other questions tagged or ask your own question.