Suppose I have a SQL query that gives me some complex data, and in order to display it properly in HTML, I came up with a method where I run the same (or similar) query twice.
To avoid running the same query twice, I can create a table in memory (max a few hundred lines), using array of arrays or anything like that.
My question is: does Postgresql has some sort of cache for the last operation, where it could be more advantageous to run the exact same query twice, instead of creating an array of arrays?