cache table calc, it's really slow