Making 1 database query now then doing some set comparisons.