Thank you all for the responses. I think I have to stay with WAL because we need to concurrently run multiple selects, sometimes from different threads. Unfortunately I also can't group together the selects in most cases because the selects depend on each other (they build a graph). I will try to group the selects where I can and try mmap and reusing the prepared statements as well as increasing the page size a lot.