Block bad scaling SQL