After 2025.01.x: Crazy MySQL Usage

Hey folks!

After Upgrading to 2025.1.x (currently using 2025.1.1) I noticed a large rise of MySQL Usage.
I am using a MySQL Percona Server 8 - which for years worked like a charm without any cpu spikes.

Here is the “new” (or broken?) SQL query:

SELECT anon_1.metadata_id, anon_1.state, anon_1.last_updated_ts, anon_1.attributes
FROM (SELECT anon_2.metadata_id AS metadata_id, anon_2.state AS state, anon_2.last_updated_ts AS last_updated_ts, anon_2.attributes AS attributes
FROM (SELECT states.metadata_id AS metadata_id, states.state AS state, 0 AS last_updated_ts, CASE WHEN (state_attributes.shared_attrs IS NULL) THEN states.attributes ELSE state_attributes.shared_attrs END
AS attributes
FROM states_meta INNER JOIN states ON states.last_updated_ts = (SELECT states.last_updated_ts
FROM states
WHERE states_meta.metadata_id = states.metadata_id AND states.last_updated_ts < 1736322599.999999e0 ORDER BY states.last_updated_ts DESC
LIMIT 1) AND states.metadata_id = states_meta.metadata_id LEFT OUTER JOIN state_attributes ON states.attributes_id = state_attributes.attributes_id
WHERE states_meta.metadata_id IN (2917, 4586, 3549, 3547, 3548, 4848, 3949, 3950, 4061, 4062, 3523, 3866, 3867, 4094, 4095, 3533, 3536, 3541, 3553, 3126, 3129, 3130, 3131, 3132, 3135, 3136, 3137, 3138, 31
41, 3142, 3143, 3147, 3150, 3151, 3152, 3153, 3156, 3157, 3158, 3159, 3162, 3163, 3164, 3489, 3556, 3506, 3515, 3555, 220, 221, 222, 223, 1428, 5, 36, 3342, 3343, 1529, 1531, 1535, 1539, 1544, 1548, 1552,
1553, 1519, 1520, 340, 341, 342, 343, 344, 345, 346, 347, 3564, 3565, 3566, 3567, 1465, 3402, 3403, 3404, 4489, 4490, 4492, 4491, 4493, 4494, 4496, 4495, 4497, 4498, 4500, 4499, 4501, 4502, 4504, 4503, 2
91, 292, 293, 297, 317, 318, 319, 323, 299, 300, 301, 302, 303, 307, 325, 326, 327, 331, 195, 215, 216, 217, 218, 219, 3441, 3448, 3449, 3450, 3477, 1462, 1463, 2871, 2872, 3787, 3788, 3740, 3741, 3308, 3
309, 2875, 2876, 2877, 2878, 2869, 2870, 2873, 2874, 3382, 3383, 2884, 2885, 2886, 2887, 2888, 2889, 2890, 2891, 3366, 3358, 274, 1965, 1968, 1969, 240, 243, 244, 230, 233, 234, 235, 238, 239, 245, 248, 2
49, 225, 228, 229, 1958, 1961, 1962, 260, 263, 264, 255, 258, 259, 839, 840, 845, 846, 847, 852, 35, 860, 865, 866, 33, 3418, 871, 39, 876, 877, 879, 3289, 885, 3288, 889, 890, 895, 896, 9, 901, 5071, 370
3, 44, 4587, 3708, 66, 10, 913, 918, 923, 924, 929, 931, 933, 937, 939, 1, 944, 945, 45, 952, 955, 956, 34, 962, 964, 965, 970, 978, 979, 985, 4659, 987, 4970, 990, 991, 992, 997, 999, 1003, 4017, 1007, 4
073, 1009, 1011, 1012, 1013, 1018, 1020, 1026, 52, 1031, 4448, 60, 1034, 1038, 2777, 3179, 3222, 4369, 5040, 4374, 971, 972, 977, 1540, 1541, 3374, 5087, 3170, 3693, 58, 23, 49, 24, 46, 1444, 1445, 42, 56
, 43, 1448, 1450, 1452, 1454, 16, 1456, 59, 1387, 30, 1388, 1389, 1390, 1391, 62, 1394, 1395, 1392, 1393, 1396, 1397, 1398, 1399, 1400, 1401, 1402, 1403, 65, 53, 28, 4866, 4867, 4868, 2806, 3827, 3828, 38
29, 3830, 3831, 3832, 3833, 3834, 3835, 3838, 3843, 3844, 4154, 4155, 4156, 4157, 4158, 4159, 4167, 4168, 4177, 4178, 4179, 4180, 4181, 4182, 4190, 4191, 4200, 4201, 4202, 4203, 4204, 4205, 4213, 4214, 42
23, 4224, 4225, 4226, 4227, 4228, 4236, 4237, 4246, 4247, 4248, 4249, 4250, 4251, 4263, 4264, 4272, 4283, 4284, 4285, 4286, 4287, 4288, 309, 4297, 798, 806, 795, 807, 793, 1926, 1928, 1929, 1931, 1933, 19
35, 250, 253, 254, 15, 27, 2, 1913, 1914, 1918, 4541, 4542)) AS anon_2 UNION ALL SELECT anon_3.metadata_id AS metadata_id, anon_3.state AS state, anon_3.last_updated_ts AS last_updated_ts, anon_3.attribut
es AS attributes
FROM (SELECT states.metadata_id AS metadata_id, states.state AS state, states.last_updated_ts AS last_updated_ts, CASE WHEN (state_attributes.shared_attrs IS NULL) THEN states.attributes ELSE state_attrib
utes.shared_attrs END AS attributes
FROM states LEFT OUTER JOIN state_attributes ON states.attributes_id = state_attributes.attributes_id
WHERE (states.last_changed_ts = states.last_updated_ts OR states.last_changed_ts IS NULL) AND states.metadata_id IN (2917, 4586, 3549, 3547, 3548, 4848, 3949, 3950, 4061, 4062, 3523, 3866, 3867, 4094, 409
5, 3533, 3536, 3541, 3553, 3126, 3129, 3130, 3131, 3132, 3135, 3136, 3137, 3138, 3141, 3142, 3143, 3147, 3150, 3151, 3152, 3153, 3156, 3157, 3158, 3159, 3162, 3163, 3164, 3489, 3556, 3506, 3515, 3555, 220
, 221, 222, 223, 1428, 5, 36, 3342, 3343, 1529, 1531, 1535, 1539, 1544, 1548, 1552, 1553, 1519, 1520, 340, 341, 342, 343, 344, 345, 346, 347, 3564, 3565, 3566, 3567, 1465, 3402, 3403, 3404, 4489, 4490, 44
92, 4491, 4493, 4494, 4496, 4495, 4497, 4498, 4500, 4499, 4501, 4502, 4504, 4503, 291, 292, 293, 297, 317, 318, 319, 323, 299, 300, 301, 302, 303, 307, 325, 326, 327, 331, 195, 215, 216, 217, 218, 219, 34
41, 3448, 3449, 3450, 3477, 1462, 1463, 2871, 2872, 3787, 3788, 3740, 3741, 3308, 3309, 2875, 2876, 2877, 2878, 2869, 2870, 2873, 2874, 3382, 3383, 2884, 2885, 2886, 2887, 2888, 2889, 2890, 2891, 3366, 33
58, 274, 1965, 1968, 1969, 240, 243, 244, 230, 233, 234, 235, 238, 239, 245, 248, 249, 225, 228, 229, 1958, 1961, 1962, 260, 263, 264, 255, 258, 259, 839, 840, 845, 846, 847, 852, 35, 860, 865, 866, 33, 3
418, 871, 39, 876, 877, 879, 3289, 885, 3288, 889, 890, 895, 896, 9, 901, 5071, 3703, 44, 4587, 3708, 66, 10, 913, 918, 923, 924, 929, 931, 933, 937, 939, 1, 944, 945, 45, 952, 955, 956, 34, 962, 964, 965
, 970, 978, 979, 985, 4659, 987, 4970, 990, 991, 992, 997, 999, 1003, 4017, 1007, 4073, 1009, 1011, 1012, 1013, 1018, 1020, 1026, 52, 1031, 4448, 60, 1034, 1038, 2777, 3179, 3222, 4369, 5040, 4374, 971, 9
72, 977, 1540, 1541, 3374, 5087, 3170, 3693, 58, 23, 49, 24, 46, 1444, 1445, 42, 56, 43, 1448, 1450, 1452, 1454, 16, 1456, 59, 1387, 30, 1388, 1389, 1390, 1391, 62, 1394, 1395, 1392, 1393, 1396, 1397, 139
8, 1399, 1400, 1401, 1402, 1403, 65, 53, 28, 4866, 4867, 4868, 2806, 3827, 3828, 3829, 3830, 3831, 3832, 3833, 3834, 3835, 3838, 3843, 3844, 4154, 4155, 4156, 4157, 4158, 4159, 4167, 4168, 4177, 4178, 417
9, 4180, 4181, 4182, 4190, 4191, 4200, 4201, 4202, 4203, 4204, 4205, 4213, 4214, 4223, 4224, 4225, 4226, 4227, 4228, 4236, 4237, 4246, 4247, 4248, 4249, 4250, 4251, 4263, 4264, 4272, 4283, 4284, 4285, 428
6, 4287, 4288, 309, 4297, 798, 806, 795, 807, 793, 1926, 1928, 1929, 1931, 1933, 1935, 250, 253, 254, 15, 27, 2, 1913, 1914, 1918, 4541, 4542) AND states.last_updated_ts > 1736322599.999999e0 AND states.l
ast_updated_ts < 1736322900.0e0) AS anon_3) AS anon_1 ORDER BY anon_1.metadata_id, anon_1.last_updated_ts

It runs for 2-3 minutes and then is replaced by a similar query.
This was introduced in 2025.x release. This is mildly annoying, as one CPU core is constantly at 100%, whirling up those noisy fans.

I did not find anything related (yet).

I think the PR associated with this was the only change:

The issue was gone when I downgraded to 2024.12.5. Silence again.
Let’s hope it is a known issue and 2025.2.x will fix that.

I have the same issue and also downgraded to 2024.12.5 to fix it.
But on MySql 8.4.3.

I had problems with the statistics that got corrupted and could not be fixed.
But unable to pinpoint the problem

Got a link to the issue?

Nope. Couldn’t find one.

Also: The issue still persists in 2025.1.3 :cry:

This is soo annyoing.