Let's say I have a small postgres database (< 500mb) , and I have app which is very read intensive 99% of requests are reads. Is there a way to tell Postgres to load all tables into RAM so it can do selects faster.? I think Oracle and SQL server have that kind of functionality.
I have done some test on my local machine, I have table with 500 records, Java HashMap Took 2ms, sql select took 12000 ms, Obviously java HashMap is faster because it is within same process but is there a way to speedup sql queries for small tables in postgres ? Thanks
for (int i = 0; i < 100_000; i++) {
//1) select * from someTable where id = 10
// 2) get from Java HashMap by key
}