[MDEV-17251] SHOW STATUS unnecessary calls calc_sum_of_all_status Created: 2018-09-20  Updated: 2021-01-12  Resolved: 2021-01-12

Status: Closed
Project: MariaDB Server
Component/s: Information Schema
Affects Version/s: 5.5, 10.0, 10.1, 10.2, 10.3
Fix Version/s: 10.2.37, 10.3.28, 10.4.18, 10.5.9

Type: Bug Priority: Major
Reporter: Sergei Golubchik Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-15135 'show global status' can cause lock c... Closed

 Description   

SHOW GLOBAL STATUS and INFORMATION_SCHEMA.GLOBAL_STATUS always invoke calc_sum_of_all_status() to aggregate values of global status variables from session status variables into a temporary buffer.

This is done even when no such aggregated variable will be returned to the user (e.g. because of LIKE 'uptime'. And calc_sum_of_all_status() can be rather expensive with many threads, see MDEV-15135, so it's a waste to call it and not use the result.

The fix could be to call calc_sum_of_all_status() from show_status_array() when it stumbles upon a first variable that needs aggregation.


Generated at Thu Feb 08 08:35:03 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.