2

I'm using a big table imported by a *.shp file of the city of San Diego. When I run pgr_dijkstra it takes more or less 5000ms, even for small distances. I was thinking, in order to improve performance, how could I select a subset of the table San Diego? And more important, do you think it would improve the performance?

My idea is to, given a starting and ending point, select only an area (a circle, square,...) that contains both starting and ending point (plus an arbitrary margin). Is it possible?

tvieira
  • 331
  • 2
  • 8

1 Answers1

3

Yes, this is common practice to speedup queries. As less data you load as faster will be the response. Bounding box selects are the fastest way to select a subset of the table. Don't forget to have an index on the geometry column though.

The following answer may give you an idea how to write your query: Why is any pgr_* routing function taking forever based on OSM data in an pgrouting enabled DB

dkastl
  • 4,786
  • 17
  • 21