Add some index in the databale to speed-up the lighttable.

This brings a big speed-up in the lighttable very noticeable when
many pictures are in the database (> 20k).