Script for tdbstats