You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cursor.execute(sql, args) cost a lots of time(about 20s) occasionally.
This problem often occurs when the query has not been used for a period of time.
The text was updated successfully, but these errors were encountered:
prettygirl20231
changed the title
excute sql cost a lots of time occasionally.
excuting sql costs a lots of time occasionally.
Nov 12, 2024
Does this happen for complex queries? I can imagine that if a connection is idle for a long time, the query cache and buffer pool needs to be re-fetched.
It could also happen when you are using too many connections and set blocking to True, but since you set it to False, you should get an error in this case.
It could be also some kind of MySQL quirk, like the ones reported here, here or here.
Without further information or reproducible code, I cannot help you with this.
Personally, I'm using PostgreSQL and never experienced problems like this.
enviroment:
mysql8.0
pymysql
python3.13
cursor.execute(sql, args) cost a lots of time(about 20s) occasionally.
This problem often occurs when the query has not been used for a period of time.
The text was updated successfully, but these errors were encountered: