List:Internals« Previous MessageNext Message »
From:bruce Date:December 7 2000 6:30am
Subject:MySQL protocol efficiency
View as plain text  
Hi,
	I imagine this has been asked before, but I can't find any reference to
it, so here goes.

I've been looking at the MySQL protocol, mainly because I would like to find
a way to make the JDBC driver work better.  In my investigation, I noticed
the following things about the protocol used between the client and server:

* It uses a 'Packet' system, despite the fact that communications are 
  occuring over a reliable socket.  There seems to be no point to this.
  It also introduces an extra copy/write cycle for the data.

* All results are sent as strings, even integers and doubles.  This leads
  to unnecessary bytes being sent down the channel (2-15 bytes being sent
  rather than 4 or 8), and the unnecessary overhead of formatting the 
  string on the server, and parsing it back in on the client. 

It would seem to me that fixing these two issues would make the protocol
faster.  I agree there are endian issues involved with sending binary data,
but there are standard C macros to convert to and from big/small endian

Changing a protocol is never easy, but the gains available here seem 
worthwhile to me.  Are there any plans to addess these issues?


-- 
Bruce Cooper
Amristar Pty. Ltd.                  mailto:bruce@stripped
Phone:9389 7844/0417 986 274        http://www.amristar.com.au
Thread
MySQL protocol efficiencybruce7 Dec
  • MySQL protocol efficiencyMichael Widenius7 Dec
    • Re: MySQL protocol efficiencybruce7 Dec
      • Re: MySQL protocol efficiencyMichael Widenius7 Dec
        • Re: MySQL protocol efficiencySasha Pachev7 Dec