HIVE-9153: improve caching