perf improvement to RMDatabaseCache when counting existing tiles