The online postgress DB runs on a powerful server (really), and SOLR search uses a whole cluster of nodes. Both are handling hundreds of requests per second.
Most search queries got answers under 200ms (but it all depends on queries).
Typical web service mean response time is under 50 ms.
But that’s with a typical request rate of ~250 req/s for web service, and 150 req/s for search.
By my standards, that’s still slow, but we are somehow limited by hardware costs.
I don’t think comparing those with a local VM meant to handle only few requests makes much sense.
Did you do actual measurements ?
What about underlying hardware (CPU/RAM/disks) ?
What about underlying operating system ?
Yes, tuning your postgres installation is very likely the most important thing you need to do in order for it to perform well. I’m not sure exactly how you installed your software, but postgres should have access to 1/4 to 1/3 of available ram in order for it to function well. A default install gives it only a few MB, which makes it… crawl.