Only query variables lower_case_table_names and character_set%% when needed

Issue #668 resolved
Former user created an issue

I am attaching a patch that stop the query of 2 variables when not needed.

In reflection of tables 2 query where always done that are only needed once per server/port combos.

I am doing this becasue round rip times is an issues for me and this cuts 2 round trip for each table that is reflected

mike@mlb.org

Comments (2)

  1. jek

    Looks like the mailing list didn't send out my reply to the original post on this, so including it here:

    You're right, the lower_case check is really needed only once per connection and I've added that per-connection cache in d0910b22755a699f71eb549dc09a9f9423580d5c for 0.4. That's as granular as that can get, as the value can change on a server restart and that can't be detected directly.

    The character set can change mid-connection and there's unfortunately no easy way around performing that check, at least for 4.1 and higher servers. It would be easier if the driver was the only mechanism to change the connection character set, but a variety of user SQL can as well.

    Moving all of the MySQL reflection to a SHOW CREATE TABLE parser is in progress for 0.4. If you have a patch in mind for column parsing I'd be happy to take a look and include it.

    As an aside, starting with 0.3.9 the table metadata is picklable. Just unpickle it and bind it to an engine, and you can avoid reflection on your slow link entirely.

  2. Log in to comment