Your Question

A very simple sql cost too many time when limit >= 85. Any idea on why? 10 times longer than when limit < 85. And I am sure it is not a slow sql. gorm ver 1.24.0

The document you expected this should be explained

Expected answer

just want to know why

Comment From: black-06

Maybe related to https://github.com/go-gorm/gorm/issues/6292#issuecomment-1534487259

Comment From: ThanksSirAlex

Is there any way that can help me track where these time were spent.

Comment From: ThanksSirAlex

Maybe related to #6292 (comment)

Not sure. It's super weird. I'm going to try more.

Comment From: aohanhongzhi

like

Comment From: ThanksSirAlex

Close this issue. Because it turn out to be a mysql bug. When using prepared statement Mysql could chose wrong index. Fixed in Mysql 8.0.26. MicrosoftTeams-image