Check for the empty seq case before .in_(seq) queries; results in an expensive
sequential scan otherwise.