Charset Narrowing optimization

You are viewing an old version of this article. View the current version here.

Charset Narrowing is an optimization that makes comparisons like utf8mb3_key_column=utf8mb4_expression sargable. It is supported for utf8mb{3,4}_general_ci character sets.

The optimization was introduced in MariaDB 10.6.16, MariaDB 10.10.7, MariaDB 10.11.6, MariaDB 11.0.4, MariaDB 11.1.3, MariaDB 11.2.2 where it is OFF by default, and in MariaDB 11.3.1, where it is ON by default.


MariaDB supports both mb3

create table t1 (col varchar(100) character set utf8);

== Controlling the optimization

The optimization is controlled by an ##optimizer_switch## flag.  Specify

set optimizer_switch='cset_narrowing=on';

to enable the optimization.



Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.