What is a Cache Hit?
Any time a value is found in a table variable for a specific set of criteria, it is considered a cache hit. All hits are stored in the cache. For example, consider the following table variable:
| Variable | Criteria | |||
|---|---|---|---|---|
|
Territory Code |
ZIP Code |
City |
County |
State |
|
1 |
75080 |
Richardson |
Dallas |
Texas |
|
2 |
75081 |
Richardson |
Dallas |
Texas |
|
3 |
75082 |
Richardson |
Dallas |
Texas |
|
4 |
75083 |
Richardson |
Dallas |
Texas |
|
5 |
75085 |
Richardson |
Dallas |
Texas |
Then the following data request would be considered a hit and a value of 3 would be stored for the mapped variable:
ZIP Code: 75082
City: Richardson
County: Dallas
State: Texas
If this same request had not been made previously, then a call would be made to the database to retrieve the information. Once obtained, the information would be stored in the cache as a hit. A subsequent request with this same information would result in the information being found in the cache, and a call to the database would not be necessary.