Config optimization for heavy query traffic

Yep, sorry I thought I had already linked my previous post focusing on the query itself but thanks for including it.

In terms of the pagecache and heap_max size, I think it was a bit of a shot in the dark to be honest- something that I had set initially as part of my bash script to spin up the instance.

Total RAM on the instance is 128GB.
Graph on disk size (assuming you mean the size of the database directory in the databases directory): 327GB

Thanks!