add indexes to the database and create new table