-- dump all files. Might be VERY VERY slow on large backup pools

select
	files.id as unique_id,
	hosts.name as host,
	shares.name as share,
	backupnum as num,
	backups.date as backup_date,
	backups.type as type,
	files.path as path,
	files.date as date,
	files.size as size,
	backups.size as backup_size
from files
join shares on files.shareid = shares.id
join hosts on shares.hostid = hosts.id
join backups on shares.hostid = backups.hostid
	and files.backupnum = backups.num
	and shares.id = backups.shareid
order by backups.date;
