trees and record caching