[MDEV-31344] I_S optimization: fast status variable lookup Created: 2023-05-25  Updated: 2024-01-23

Status: Stalled
Project: MariaDB Server
Component/s: Information Schema
Fix Version/s: 11.5

Type: Task Priority: Major
Reporter: Sergei Golubchik Assignee: Andrew Hutchings
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-31342 I_S optimization: avoid temp table Stalled

 Description   

INFORMATION_SCHEMA.GLOBAL_VARIABLES, INFORMATION_SCHEMA.SESSION_STATUS and other tables for global/session/system status/variables are often queried for just one variables:

select variable_value from information_schema.global_status where variable_value='uptime'

Currently it's a linear search in the array with all variables. Recursive, because some elements of the array may be pointers to sub-arrays or to functions generating sub-arrays.

This can be changed to

  1. a hash with all variables that aren't dynamically generated by a function call
  2. an array with all prefixes that need a function call to generate full variable names.

almost all variables will be in the hash, the array will be very small, less than 10 elements, may be even empty (depends on what plugins are loaded).

Thus the new approach can be: if the variable name is fully specified in the query, no wildcards, then do a hash lookup, and if nothing is found check the array of prefixes.


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