Run type='%1' query only once (much faster)