How do I tune postgres to quickly find the shortest path on a large dataset (4M)?

المشرف العام

Administrator
طاقم الإدارة
My graph has ~4M rows, and I am running it on 2.55GHz machine.

When postgres gave it the default amount of memory settings, it took my ~55 seconds to run the pgr_ksp function against it (where k is < 4).

Increasing postgres' work_mem and maintainence_work_mem didn't improve performance at all.

I added indices the source, target and gid columns, and this seemed to decrease overall performance by 1 second.


I'm a little bit at a loss for how to make this reasonably fast (
 
أعلى