Re #1692 prevent query repeats and not fetch rows which are not required

@jonpday please review
:+1: great! I’ve seen a large `eav_attribute_option` table with many blank rows.