added procedure and sql for recreating indexes