Page 1 of 1

Database VIEWs - like a cache?

Posted: Fri Nov 13, 2009 3:17 am
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?

Re: Database VIEWs - like a cache?

Posted: Fri Nov 13, 2009 4:45 am
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.

Re: Database VIEWs - like a cache?

Posted: Fri Nov 13, 2009 4:47 am
by VladSun