add an index to temp table to speed up word counting