django-mysql icon indicating copy to clipboard operation
django-mysql copied to clipboard

HANDLER use prepared statements on MariaDB

Open adamchainz opened this issue 10 years ago • 2 comments

Since MariaDB 5.3 HANDLER has supported prepared statements: https://mariadb.com/kb/en/mariadb/handler-commands/

"Starting from MariaDB 5.3 prepared statements work with HANDLER READ, which gives a much higher performance (50 % speedup) as there is no parsing and all data is transformed in binary (without conversions to text, as with the normal protocol)."

Would make handlersocket in #14 less important.

adamchainz avatar Mar 21 '15 18:03 adamchainz

How-to http://varokism.blogspot.co.uk/2011/01/20-to-50-improvement-in-mariadb-53.html

adamchainz avatar Mar 21 '15 18:03 adamchainz

So this isn't possible with mysqlclient/MySQLdb - there is no (binary) API for the handler statements. The only thing I know that implements prepared statements is the (kinda dead) oursql - but then didn't provide a user-facing API but instead did it for every statement on cursor.execute - see https://bugs.launchpad.net/oursql/+bug/1046706 .

Guess one would have to add the functionality to mysqlclient before starting here.

adamchainz avatar Mar 30 '15 04:03 adamchainz

HANDLER dropped in #814.

adamchainz avatar Aug 08 '23 05:08 adamchainz