[CONJ-101] [PATCH] minimize connection overhead Created: 2014-05-23  Updated: 2014-09-17  Resolved: 2014-05-25

Status: Closed
Project: MariaDB Connector/J
Component/s: None
Affects Version/s: None
Fix Version/s: 1.1.8

Type: Bug Priority: Minor
Reporter: Vladislav Vaintroub Assignee: Georg Richter
Resolution: Fixed Votes: 0
Labels: None

Attachments: File diff.diff    

 Description   

Recently, MySQL at Facebook (Harrison F) have analyzed the overhead of the JDBC connection creation, also for MariaDB JDBC (https://www.facebook.com/notes/mysql-at-facebook/jdbc-connection-overheads/10152027251270933 ) He found that this driver issues 3 calls upon. One of them ("USE test") was fixed recently in CONJ-93. Attached patch eliminated the remaining two

1. The extra "set autocommit" is a bug (typo), it should be issued if
ServerStatus.AUTOCOMMIT is not set, but due to the typo was issued
when autocommit was already set.

(Note though, that there is currently a server bug http://bugs.mysql.com/bug.php?id=66884 about this flag incorrectly set if global value of autocommit=0. This should be not a big problem, I think)

2. It it not necessary to retrieve sql_mode just to check whether NO_BACKSLASH_ESCAPES is set, there is a corresponding flag in the OK/EOF packets.

So this patch also removed the need in fastConnect option, because currently it will be fast in any case.



 Comments   
Comment by Georg Richter [ 2014-05-25 ]

Fixed in rev. 509

Generated at Thu Feb 08 03:13:10 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.