Caching mysql queries
am 28.08.2006 02:26:12 von Peppi
Beginners question:
I'm a little confused about the working of the mysql-cache. I don't
understand the mechanism. What is it exactly you cash ? The result of a
query ? And what if there are certain records addes or removed ?
Please explain this because I need this knowledge to support a customer
of mine who wants to know this technique in detail.
Thnx,
Peter
Re: Caching mysql queries
am 28.08.2006 07:28:46 von Bill Karwin
Peppi wrote:
> I'm a little confused about the working of the mysql-cache. I don't
> understand the mechanism. What is it exactly you cash ? The result of a
> query ? And what if there are certain records addes or removed ?
Right, the results of a query are cached, if possible. They are
associated with the exact query that generated the results.
If any records are added or removed or updated in the underlying table,
the cached result set is invalidated and discarded. The next execution
of that query must be run against the current state of the table. The
results will be cached again, and that cached copy can be reused while
the table is unchanged.
> Please explain this because I need this knowledge to support a customer
> of mine who wants to know this technique in detail.
Why don't you read the chapter in the documentation and then come back
if you have more specific questions. Your questions are probably
answered there.
http://dev.mysql.com/doc/refman/5.0/en/query-cache.html
Regards,
Bill K.
Re: Caching mysql queries
am 28.08.2006 13:03:01 von Peppi
As you said, more answers were found in the documentation.
Thanks Bill !
Peter.
Bill Karwin schreef:
> Peppi wrote:
> > I'm a little confused about the working of the mysql-cache. I don't
> > understand the mechanism. What is it exactly you cash ? The result of a
> > query ? And what if there are certain records addes or removed ?
>
> Right, the results of a query are cached, if possible. They are
> associated with the exact query that generated the results.
>
> If any records are added or removed or updated in the underlying table,
> the cached result set is invalidated and discarded. The next execution
> of that query must be run against the current state of the table. The
> results will be cached again, and that cached copy can be reused while
> the table is unchanged.
>
> > Please explain this because I need this knowledge to support a customer
> > of mine who wants to know this technique in detail.
>
> Why don't you read the chapter in the documentation and then come back
> if you have more specific questions. Your questions are probably
> answered there.
>
> http://dev.mysql.com/doc/refman/5.0/en/query-cache.html
>
> Regards,
> Bill K.