Added some database indexes
added logging for sql queries in dev settings