Pushing some filtering onto the DB.