assistenza
There are many things you can do but it’s all server/database related (except one thing). If you are using MariaDB 10.5+ then it’s advisable to switch to MySQL 8.0+ as it comes better optimized out-of-the-box. Either database you use it’s advisable to run through the respective Optimization Guides for each (MariaDB | MySQL). You should also make sure the server and database server has sufficient resources (RAM and CPU). You can also run the following queries in SQL to see if they help any.
-- Should be roughly 75% of the server’s total memory. Set in bytes [int] (eg. `1073741824` is 1 GB) or human readable size [string] (eg. `'1 GB'`)
--
-- Select total buffer pool size in human readable format (GB)
SELECT @@innodb_buffer_pool_size/1024/1024/1024;
-- Set buffer pool size to desired value
SET GLOBAL innodb_buffer_pool_size = total_size_here;
-- Run ANALYZE to generate histograms for tables to improve performance
--
-- Repeat for each table and replace table_name with each table's actual name
ANALYZE TABLE `table_name` PERSISTENT FOR ALL;
Lastly, you can try this patch:
Cheers.