[CONJ-1077] Add `rewriteBatchedStatements` option in Mariadb CONJ for MySql database compatibility. Created: 2023-05-15  Updated: 2023-12-15  Resolved: 2023-12-15

Status: Closed
Project: MariaDB Connector/J
Component/s: JDBC compatibility, MySQL compatibility
Affects Version/s: 3.0.0, 3.0.3, 3.0.4, 3.0.5, 3.0.6, 3.0.7, 3.0.8, 3.0.9, 3.1.0, 3.0.10, 3.1.1, 3.1.2, 3.1.3, 3.1.4
Fix Version/s: N/A

Type: New Feature Priority: Major
Reporter: Pranjal Gupta Assignee: Diego Dupin
Resolution: Won't Do Votes: 1
Labels: MySQL8, Mysql, rewriteBatchedStatements


 Description   

Add `rewriteBatchedStatements` option in Mariadb CONJ for MySql database compatibility. The support for Add `rewriteBatchedStatements` option is removed from the driver from version `3..`, this was good for performance with MySql database. Currently there is no alternate option (other than writing query manually) to do bulk updates to MySql database, The new options `useBulkStmts` uses protocol `COM_STMT_BULK_EXECUTE`, which is no supported for MySql so services using Mriadb CONJ will be at performance loss. Everyone prefers Mariadb CONJ because of its better performance than MySql connector/j and LGPL license, So it would be very nice to have back the `rewriteBatchedStatements` option in the new versions.



 Comments   
Comment by Diego Dupin [ 2023-12-15 ]

in 2.x there was indeed this option `rewriteBatchedStatements`, to permit fast batch.
Now, current implementation that use BULK insert that is faster, and connector doesn't have to parse command client side anymore, additionnaly BULK works for UPDATE and DELETE as well.

The problem is that indeed, for server that doesn't support BULK (MySQL/MariaDB before 10.2) will have a basic batch implementation, pipelining commands.

Fixing performance issues for MySQL that doesn't have BULK isn't the best solution. I would recommand to switch to MariaDB server.

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