Added some more indexes to db (thanks to Pablo Ojanguren @pablojan). Fix #510