Query cache stores "select" query together with its results. When the same query is sent again, result from the cache is returned.
Whenever some table is modified, all cache entries referencing it are deleted. That happens even when modification doesn't affect cached rows, eg.: SELECT a FROM a_table WHERE id = 1; # Result gets cached UPDATE a_table SET a = 2 WHERE id = 2; # Result is removed from the query cache SELECT a FROM a_table WHERE id = 1; # Query cache can't be used On Mon, Apr 20, 2009 at 12:56 PM, Lin Chun <franks1...@gmail.com> wrote: > Hi > I don't know very well MySQL, the query cache is something like the > Snapshotone of the s mod listed in the query is modified, the > in Oracle, so we can get the result immediately? > > > > > > On Mon, Apr 20, 2009 at 11:47 AM, Olexandr Melnyk <omel...@gmail.com> wrote: >> >> On Mon, Apr 20, 2009 at 12:41 PM, Lin Chun <franks1...@gmail.com> wrote: >> > HiĀ Olexandr Melnyk >> > >> > That's to say, create the aggregation tables and update them by >> > triggers? >> > I've noticed a "update view" in Mysql , can it work under the aggretate >> > operation? >> >> You're not looking for views, you need to use normal tables. >> >> If you will update the table by triggers, it will always be up-to-date >> but query cache will be cleared on every such update. >> >> On the other hand, if you do it periodically, data will not always be >> accurate, but query cache can be used efficiently. >> >> > >> > On Mon, Apr 20, 2009 at 11:34 AM, Olexandr Melnyk <omel...@gmail.com> >> > wrote: >> >> >> >> No, you will have to "emulate" them using triggers or stored >> >> procedures. >> >> >> >> >> >> >> >> -- >> >> Sincerely yours, >> >> Olexandr Melnyk >> >> http://omelnyk.net/ >> > >> > >> > >> > -- >> > ------------------------- >> > Lin Chun >> > >> >> >> >> -- >> Sincerely yours, >> Olexandr Melnyk >> http://omelnyk.net/ > > > > -- > ------------------------- > Lin Chun > -- Sincerely yours, Olexandr Melnyk http://omelnyk.net/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=arch...@jab.org