When dealing with several tables at once—especially large ones—tuning queries, tables, and geometries becomes a major consideration. The way you express your queries is also important because the same logic expressed with two different SQL statements can have vastly different performance. The complexity of geometries, memory allocation, and even storage affect performance.
pgRouting: A Practical Guide is available in Hardcopy from Hardcopy from Amazon. E-Book or Bulk discounts on Hard-copy from Locate Press.