automate db indexing