in reply to A database caching scheme

What is your database? oracle/MySQL?
If you have to use a complicated query to retrieve data, how come you can update directly?
As already mentioned, temp tables might be the way to go stored on the database.