MySQL Forums
Forum List  »  Performance

Re: Query Cache and simultaneous execution
Posted by: Jay Pipes
Date: November 17, 2005 10:40AM

James Bromberger wrote:
> ... and pretty quickly
> we're spiraling down into oblivion; each extra
> thread is delaying the first one from coming up
> with a result as the system sinks under load.

Have you actually witnessed this happen or is this a theory?

> So, is it feasible fo rthe QCache to be extended
> so that, when the first thread looks at the cache,
> it inserts a placeholder into the QCache with a
> mark showing that it is now executing this query,
> and permitting other subsequent threads to see
> that they should wait for a few milliseconds and
> check the cache again to see if the result has
> been returns and the cache now populated? Sort of
> like a semaphore to prevent spiralling into a
> deadlock of resources. Perhaps have a timestamp as
> to when the lookup started, so we can see if it
> was recent (within 60 (configurable) seconds?) in
> case the executing thread was killed, to prevent a
> stale cache.

Sure. Issue a LOCK TABLES explicitly before the execution of the first thread. I believe that would force a wait of the other threads until the first has completed, at which point the query cache would contain the desired result set and things would proceed smoothly.

Jay Pipes
Community Relations Manager, North America, MySQL Inc.

Got Cluster? http://www.mysql.com/cluster
Personal: http://jpipes.com

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Query Cache and simultaneous execution
1541
November 17, 2005 10:40AM
1579
November 17, 2005 05:19PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.