once you start page faulting and hitting spinning disk it's game over for any database's performance, postgres included.
The whole point of btree indexes is that they're efficient to query from disk.
a few seeks aren't terrible for small/medium applications, but when you're asking for thousands of queries a second any disk access is bad news.
I have a script that grows a bit Perl hash. It fills up memory and starts paging. The application grinds to a halt (almost). I tie the hash to Berkly DB file, so it writes to disk. Performance is about a third of the in memory hash, BUT doesn't slow when it's too big for memory.