The query was doing a MAX() on string data which is probably heavy work for the DB. It was getting meta values but not needing them. This changes it to max on the meta id instead.
How to test
The function is really only ever used on the "Convert" page. Compare the counts with and without the patch.
The query was doing a MAX() on string data which is probably heavy work for the DB. It was getting meta values but not needing them. This changes it to max on the meta id instead.
How to test
The function is really only ever used on the "Convert" page. Compare the counts with and without the patch.