120-130 ms for selecting one row most likely indicates a network delay, as Lukos suggests, and you can reduce this by completing your queries closer to the database server. However, 2-3 seconds of latency will most likely have a database speed - in particular, I / O bandwidth. This is why Heroku emphasizes that the difference in database offerings is related to cache size.
Heroku Postgres stores your data on Amazon EBS . (This is revealed in the incident report and, incidentally, will also explain the 1 TB limit.) EBS performance is a bit like a roller coaster; much more than local drives. Some readings may be fast, while others may be slow. Sometimes the whole volume drops to 100 KB / s, sometimes it gives off an interconnect.
In my experience of hosting databases in EC2, I found that running RAID 10 on EBS smooths out differences in performance. I do not think Heroku is doing this, as it will significantly increase costs that exceed database plans. AWS recently announced IOPS for EBS , which will allow you to pay for the allocated capacity, further increasing predictability, but also increasing costs.
source share