The Wordpress get_terms can cause performance issues if the taxonomy has...

... many terms. Only perform get_terms if id fields are not used in the tax query.