Bug #105913 | Add table user_variables in performance_schema | ||
---|---|---|---|
Submitted: | 16 Dec 2021 4:28 | Modified: | 17 Dec 2021 8:45 |
Reporter: | chenguang pei | Email Updates: | |
Status: | Won't fix | Impact on me: | |
Category: | MySQL Server: Performance Schema | Severity: | S4 (Feature request) |
Version: | 8.0 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | user_variables;performance_schema; |
[16 Dec 2021 4:28]
chenguang pei
[16 Dec 2021 14:55]
MySQL Verification Team
Hi Mr. p, Thank you for your feature request report. We think that it makes sense to have a list of the defined and stored user variable, out of context of the stored routines or triggers. We just do not think that P_S is the correct place for it. Anyway, we are verifying your report as a valid feature request and we shall leave it to our colleagues on how and when to implement it. Since it is a feature request, it can go only into 8.0 version. Regarding the implementation and other info, this report will be updated once that those decisions are made. We do not know when will it happen. Verified.
[17 Dec 2021 8:45]
Marc ALFF
Thanks for the feature request. Instead of writing: "select variable_name, variable_value from performance_schema.user_variables_by_thread where thread_id=(select thread_id from performance_schema.threads where processlist_id=connection_id())". a more efficient query is: select * from user_variables_by_thread where THREAD_ID = ps_current_thread_id(); which makes use of the ps_current_thread_id() native function. This avoids a full scan on table threads, and a join. Also, given the primary key PRIMARY KEY (`THREAD_ID`,`VARIABLE_NAME`) in table performance_schema.user_variables_by_thread, the performance of this query should be acceptable. There is no compelling reason to create another performance schema table just for this.