count number of entries in tables (one for each index)