Quantcast
Channel: Teradata Developer Exchange - Blog activity for carrie's blog
Viewing all articles
Browse latest Browse all 1058

Request Cache Hits & Misses - comment by carrie

$
0
0

Pierre,
 
YOUR QUESTION:  How does the optimizer recognize a "query" as being already in cache from another query being not ?
 
Strictly speaking it is request (a request can consist of multiple queries), not a query, that is being processed.
 
It hashes the request text and looks up if there is a hit is cache. If there isn’t a hit, it is not in cache. If there is a hit, it checks to see request text matches the cached request text and also checks some other things for a match.  If everything matches, the request is in cache and otherwise not.  If it is cached, it may not or may not have a plan – for specific, it won’t, generic it will, etc.
 
YOUR QUESTION:  I understand that every query is marked as an entry in the query cache, even before the execution plan is kept (as "generic") or not, right ?
 
In general, every request (that is, its request text and other limited number of items, but not the plan) is put in the cache to indicate request has been seen if it is not already in the cache. There may be some exception where we don’t think that kind of request needs to be cached.   These entries are relatively small since they don’t have a plan.  If a plan is decided to be cached, it is cached.  If request is not seen again soon, it will probably be pushed out of cache to hold info about other requests.
 
Regards, -Carrie


Viewing all articles
Browse latest Browse all 1058

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>