hum, there's something that show the "cost" of each optimization in mariadb, like the mysql optimizer_trace?
i'm thinking about the MDEV-350 about self tune coeficients, the first task is find all constants that are used in "cost" values