How a PHP application can retrieve huge data through MySQL, which exceeds the value of max_allowed_packet

Optimization a script. One idea is to collect about 3 million rows using Select and store on the next few “Select” s (sending requests over and over, rather than a single execution). So my max_allowed_packet is 32 MB and each line has an average of 50 bytes. So, when I did the math, I had a number of about 655 thousand, which should fill a 32 MB space.

It was just so interesting how MySQL manages to send data even more than the maximum packet size. The maximum that I was able to get (and you have a heart) is 6 million lines.

Source - http://dev.mysql.com/doc/refman/5.1/en/packet-too-large.html

Thank your help in this, as soon as I understand this, I can create the right reserve (remember, the idea is to optimize and not break it.)

+4
source share

Source: https://habr.com/ru/post/1624427/


All Articles