Updated the database completeness test to use joins to find the missing records.