We are upgrading our server and I have this stored procedure that MySQL
8 really seems to hate. In real world usage I was seeing a complex
select with multiple calls to it and 14K rows take 4 seconds on 5.6 and
20 minutes on MySQL 8. But I made it in...