[MDEV-24212] ANALYZE TABLE far slower and collects wrong optimizer statistics Created: 2020-11-14 Updated: 2021-12-14 Resolved: 2021-12-14 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer, Server |
| Affects Version/s: | 10.3.26 |
| Fix Version/s: | 10.6.5 |
| Type: | Bug | Priority: | Major |
| Reporter: | Tech Magos | Assignee: | Sergei Petrunia |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | Compatibility | ||
| Environment: |
Linux Centos 7.x |
||
| Description |
|
The relevant database used for long time without such issues under a few revisions of 10.3.x. Larger table of 500k rows is: On 10.3.26 (10.3.27 as same behaviour): Restarting the db on 10.3.22, running ANALYZE on it (taking 2-3 secs), then stopping it and restarting on 10.3.27, makes the query fast again. But gets very slow after another ANALYZE TABLE. This issue may be present since 10.3.23; can try and provide you info. This makes it impossible for us to upgrade. Also, can ANALYZE TABLE, for large tables, be made to run on a portion of the table as per given parameter? Seems it now is extermely slow for large tables, prohibitive to run for a 24x7 env (where we now run a few times per day). |
| Comments |
| Comment by Elena Stepanova [ 2021-01-11 ] |
|
Please paste the output of SHOW CREATE TABLE and SHOW INDEX IN for all tables contributing (as far as you can tell) into the problem. |
| Comment by Tech Magos [ 2021-02-05 ] |
|
Table schema was already in the description here in more detail + Show index IN fro the table that suffers this issue: CREATE TABLE T ( Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Index_type cnf: [mysqld] query_cache_type=1 basedir=/thepath/maria table_cache=12000 transaction_isolation=READ-COMMITTED key_buffer_size=128m slow_query_log=1 |
| Comment by Tech Magos [ 2021-12-01 ] |
|
You can close this one, do not see it anymore in later versions of mariadb e.g. 10.6.5 |