I have a db_multirow that seems to take a while, or at least the page takes a long time to return. I want to cache the database result, and just have it get updated when the contents of the database change.
First, I looked at util_memoize, but I don't see an easy way to get it to work with db_multirow.
Second, I thought to myself that perhaps the database (postgresql 7.2.3) is smart, and caches the results in RAM. So I went to examine the log and see how much of the delay is due to database and how much to tcl and the RP and how much to network transmission time. But all of the log entries (in debug mode) corresponding to a request have exactly the same timestamp ([20/Feb/2003:18:17:44][15424.5126] - what exactly does the second block mean?).
So:
1) How do I use util_memoize, which takes the results of a function call, in conjunction with db_multirow, which works by stuffing a variable?
2) Does the database cache this sort of thing? If so, how can I tell?