save records and indexes