On Windows systems, the engine independend index statistics are incorrect for large tables.
The problem can be simulated as follows:
1. install a new MariaDB 10.4.13 server on Windows.
2. connect to the server and use the "test" schema.
3. switch on engine independent statistics.
4. create a table with about 60000 rows.
5. create index on TABLE_CATALOG.
Since the TABLE_CATALOG column always contains the same value, the expectation is that avg_frequency equals rowcount (about 60000).
This query returns about 60000.
However, the table mysql.index_stats shows only about 16000 as avg_frequency for the TABLE_CATALOG column.
On Linux, the values are as expected.
The wrong values lead to very bad execution plans for larger tables.
Furthermore my expectation is that Windows and Linux will behave the same.