Fix slow reindexing on MariaDB

Reindexing on MariaDB 10.4 takes more time compared to other MariaDB or MySQL versions.
As a workaround, we suggest modifying the default MariaDB configuration and setting the following parameters:

optimizer_switch=’rowid_filter=off’
optimizer_use_condition_selectivity = 1

With this parameters catalog product reindex finish after 7 sec, without 5 min !!!
It will be useful for those who use Mark Shust docker-magento:

db:

image: mariadb:10.4

command:

--max_allowed_packet=64M

--optimizer_use_condition_selectivity=1

--optimizer_switch="rowid_filter=off"

ports:

- "3306:3306"

env_file: env/db.env

volumes:

- dbdata:/var/lib/mysql

extra_hosts: *appextrahosts

https://experienceleague.adobe.com/docs/commerce-operations/performance-best-practices/configuration.html

submitted by /u/netmouse_ua
[link] [comments]