I know from varying sources around the web, that I can set the max_allowed_packet upto 1GB, but by default is usually 16MB.
My question is what is the optimum size for a packet (query)? I often break very large queries into smaller chunks, of say 5 or 10 MB, but is there an optimum size or is it a case of the bigger, the quicker?
Note, this is using the mysql command line utility, not any programming language.
I would be more concerned about execution time and the impact on other operations than the query size itself. Usually you do larger queries to restore from back-ups and the processing time isn’t as much of an issue.
The only way to know how it is in your instance is to benchmark it.