Closes T2803.
Before, ls history/by-date/ took a few seconds and it was getting slower
the more metadata were stored in the sqlite cache. This was because it
would query the metadata cache for all SWHIDs in history.
Now, a new table has been created to store a relation swhid -> date,
meaning we only need to do one query to get all history with a specific
date prefix.
WIP: cache: add index in all tables