Database VIEWs - like a cache?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Database VIEWs - like a cache?

Post by onion2k »

I've trawled through the MySQL manual but I can't find an answer to this - is a VIEW cached and just updated when one of the tables in it is updated (with an INSERT, UPDATE, DELETE, etc)? I have a query that always features a very complicated subquery that never actually changes. Would changing the subquery to be a VIEW, and then just querying the VIEW be a good idea?
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Re: Database VIEWs - like a cache?

Post by Weirdan »

From what I know MySQL doesn't support materialized views as of yet - this means the underlying select would be performed on each query involving the view.
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Database VIEWs - like a cache?

Post by VladSun »

There are 10 types of people in this world, those who understand binary and those who don't
Post Reply