ejurgensen/forked-daapd — pull request #71 by chme (2014-12-22 07:53:21+00:00)
Title: Improve select queries for files table

While poking around in db.c, i took a shot at further improving performance. One issue with long running select queries to the files database table for e. g. album or artist lists is, that it always joins the groups table. This is necessary to retrieve the group id (only the persistent id of the group is saved in the files table).

This pr removes the persistent id column from the groups table and makes the group id persistent over restarts. This allows to save the group id in the files table (songartistid and songalbumid) and to eliminate the join in the select queries. The triggers for inserts and updates to the files table are replaced by an explicit select/insert to the groups table.