Slow insert due to insufficient max_stmt_length #717
Unanswered
0xhf
asked this question in
Issue report
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe the bug
I have been experiencing slow inserts using executemany. I noticed the max_stmt_length constant in cursor.py which the documentation claims to default to ~1MB (1024000), is actually set in the code to 64KB. Is there any historic reason for such small limit?
This forces the client to split inserts into many requests and degrades bulk insert performance significantly.
MySQL max_allowed_packet currently defaults to 64MB, and I am using 16MB as a workaround with great results.
At this point, I am not sure whether it is preferable to update the constant, the documentation, or make it easy for developers to tweak this (maybe explain in the executemany docs).
Environment
No response
How did you install libmysqlclient libraries?
No response
What version of mysqlclient do you use?
No response
Docker command to start MySQL server
No response
Minimum but complete code to reproduce
No response
Schema and initial data required to reproduce.
No response
Commands, and any other step required to reproduce your issue.
No response
Beta Was this translation helpful? Give feedback.
All reactions