database setup and indices