[pgrouting-users] What is the architecture of pgRouting and how can I make it work faster?

Martin Lee martinchlee at gmail.com
Wed Aug 3 08:03:19 EDT 2011

[Small note: The author of this question is familiar with PostGIS, but is
not familiar with C language]

I have a 'ways' table in PostGIS consisting of about 90,000 ways. When I do
a pgRouting shortest path query it takes about 2,5 seconds to get the

I was pretty unsatisfied with it (I would like it to be about 1 second for
my imagined user) so I tried to do a 'select * from ways' query in psql with
\timing enabled. It took 3 seconds to respond. When I did 'select name,
length, x1, y1, x2, y2 from ways' (that is all needed to build a graph in my
opinion) it took even more - 4 seconds to respond.

Based on that, I assume that pgRouting's SQL queries are somehow optimized.

The questions:
1. Is it possible to improve the speed of pgRouting queries?
2. How is the actual shortest path calculation done? Is it anything like the
- Load the whole ways/edges table into memory with one 'select * from ways';
- Build a graph from that;
- Apply a C-based shortest path algorithm to the graph;
- Return a result into psql server?

Can any of these steps be improved anyhow?

Thank you!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/pgrouting-users/attachments/20110803/dea00ce3/attachment.html

More information about the Pgrouting-users mailing list