Documentation Home
MySQL Internals Manual
Download this Manual
EPUB - 0.8Mb


MySQL Internals Manual  /  ...  /  Uncompressed Payload

14.4.4 Uncompressed Payload

For small packets it may be to costly to compress the packet:

  • compressing the packet may lead to more data and sending the data uncompressed

  • CPU overhead may be not worth to compress the data

Tip

Usually payloads less than 50 bytes (MIN_COMPRESS_LENGTH) aren't compressed.

To send an uncompressed payload:

Sending a SELECT 1 query as uncompressed payload to the server looks like:

0d 00 00 00 00 00 00 09    00 00 00 03 53 45 4c 45    ............SELE
43 54 20 31                                           CT 1

decodes into:

raw packet length                      -> 20
compressed payload length   = 0d 00 00 -> 13 (20 - 7)
sequence id                 = 00       ->  0
uncompressed payload length = 00 00 00 -> uncompressed

... with the uncompressed payload starting right after the 7 byte header:

09 00 00 00 03 53 45 4c 45 43 54 20 31 -- SELECT 1

User Comments
Sign Up Login You must be logged in to post a comment.