on-internet
← Community

MariaDB query is much faster when using CAST() on bound parameters?

Stack Overflow ·

Update for those interested: https://github.com/MariaDB/server/pull/5906 We use a MariaDB database (with stored procedures) and pass params via PHP middleware. A minimal example of the table and view defintion I'm using: CREATE DATABASE cast_demo CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; USE cast_demo; SET NAMES utf8mb4 COLLATE utf8mb4_general_ci; CREATE TABLE example_data ( id INT NOT NULL PRIMARY KEY, x VARCHAR(32) NOT NULL, y VARCHAR(32) NOT NULL, amount INT NOT NULL, KEY ix_xy (x, y) ) ENGINE=InnoDB DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; INSERT INTO example_data

Comments

Sign in or sign up to comment and upvote.

No comments yet.