List:Internals« Previous MessageNext Message »
From:bruce Date:December 7 2000 9:35am
Subject:Re: MySQL protocol efficiency
View as plain text  
On Thu, Dec 07, 2000 at 10:51:13AM +0200, Michael Widenius wrote:

> The extra bytes is not a major overhead as most results are small. The
> formatting of numbers is however a major overhead that we want to get
> rid off!

Good, then it has been noticed.

> To maintain the compatibility to old clients, we plan to solve this
> approximately the following way:
> 
> - Extending the MySQL interface so that the user can bind variables to
>   the parameters and results.
> - When a uses uses the new bind function, we will tell the server this
>   by using COM_BINARY_QUERY instead of COM_QUERY.
> - The server will now send the data binary and the client will store
>   it in binary format.
> - When the client executes mysql_fetch_data(), we will then copy
>   the data to the bound variables.
> - We will also support binding of strings to pointers, to avoid
>   having to copy the data.


I didn't notice it on the "things that need to be implemented" list. I
take this to mean that it's a fairly low priority :(



> Now we only need someone to implement the above :)

Perhaps if I get bored over the hollidays.  It would be nice to 
contribute.


Now for another question.  It is possibly related the points above. 
What is the overhead of parsing a SQL query from a string into it's 
intermediate format (the format that the server uses to process
the query)?  

If it is significant and the query is used multiple times with only a
few constants changing, then pre-parsing it and using the intermediate 
form will save you time.  This obviously isn't a new idea, as it's
the basis of the JDBC PreparedStatement, but I think it could prove
very useful.



-- 
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