Eviction policy Algorithm
zero-cost plans are removed from cache
the cost of all other plans is reduced by half
One cycle updates the cost of at most 16 entries for every cache store
Costing of cache entries
Adhoc plans
cost is considered to be zero, increased by 1 every time the plan is reused
Non-adhoc queries
based on three factors: I/O, context switches, and memory
On plan re-use the cost is reset to the original cost