[MDEV-29693] ANALYZE TABLE still flushes table definition cache when engine-independent statistics is used Created: 2022-10-04 Updated: 2024-01-05 Resolved: 2023-08-19 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 10.5.13, 10.5.18, 10.6.14 |
| Fix Version/s: | 10.6.16, 10.10.7, 10.11.6 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Valerii Kravchuk | Assignee: | Elena Stepanova |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Attachments: |
|
||||||||||||
| Issue Links: |
|
||||||||||||
| Description |
|
In one connection run a slow query against it, like this: MariaDB [test]> select sleep(100) from t1; Now in another one try this:
No problem so far, but if we with to 'preferable' to force engine-independent statistics collection even by default:
we are forced to wait for the query in the first connection to complete, this way:
So, the fix for |
| Comments |
| Comment by Oleg Smirnov [ 2022-12-10 ] | |||||||||||||||||||||||||||||||||||||
|
psergei, I have finally fixed all memory issued reported by sanitizers and am passing this task for review. Branch bb-10.5-
serg suggested to discuss whether this a bug fix or a feature, I'm not sure but think this affects whether this should be merged into ES/CS and the target versions. Also there is a minor question to discuss:
| |||||||||||||||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2023-01-16 ] | |||||||||||||||||||||||||||||||||||||
|
Part of review input: There is actually no point in get_stat_values being a virtual function. There is no scenario where we call X->get_stat_values() when we're not sure about the type of X. Proof: get_stat_values_no_need_to_be_virtual.diff | |||||||||||||||||||||||||||||||||||||
| Comment by Oleg Smirnov [ 2023-07-20 ] | |||||||||||||||||||||||||||||||||||||
|
Discussions of performance impact of the change: | |||||||||||||||||||||||||||||||||||||
| Comment by Oleg Smirnov [ 2023-07-26 ] | |||||||||||||||||||||||||||||||||||||
|
Fresh benchmarks of bb-10.5- | |||||||||||||||||||||||||||||||||||||
| Comment by Oleg Smirnov [ 2023-08-01 ] | |||||||||||||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||||||||||||||
| Comment by Michael Widenius [ 2023-08-05 ] | |||||||||||||||||||||||||||||||||||||
|
Suggested final version pushed to bb-10.5-monty. | |||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2023-08-17 ] | |||||||||||||||||||||||||||||||||||||
|
Run with --repeat=N if it doesn't fail right away.
| |||||||||||||||||||||||||||||||||||||
| Comment by Michael Widenius [ 2023-08-19 ] | |||||||||||||||||||||||||||||||||||||
|
Working with Elena to fix issue in patch
| |||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2023-08-22 ] | |||||||||||||||||||||||||||||||||||||
|
Was any 10.10 version of this prepared or tested before this was pushed to 10.5? These changes seem to conflict with | |||||||||||||||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2023-09-07 ] | |||||||||||||||||||||||||||||||||||||
|
Note for the changelog: Running a variant of ANALYZE TABLE statement that collects EITS statistics used to cause a table definition cache flush. Now it is no longer done. A user-visible effect of this is as follows: if one connection runs a long query Q1 that uses the table and the other connection runs ANALYZE TABLE statement that collects EITS statistics for that table, all further queries had to wait until Q1 finishes. Now it's no longer the case. | |||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2023-10-10 ] | |||||||||||||||||||||||||||||||||||||
|
This was finally merged to 10.10. |