Added database index and a small test