System variables can be session, global, or both. sql.IncrementStatusVariable is a helper method that primarily helps the "both" category increment the global and session counters for certain variables. Threads_running is a global only variable that is incremented/decremented every begin/end query, and gets a lot of traffic. The old code used sql.IncrementStatusVariable to increment Threads_running, which was a particularly expensive way to increment a global var because (1) we'd make a new error for every call to the session updater, and (2) the extra map lookup is unnecessary. We don't do the extra map lookup now, and we weren't using the error return so I removed the return variable.
Note: this also refactors status variables to be explicitly initializated in the engine
System variables can be session, global, or both.
sql.IncrementStatusVariable
is a helper method that primarily helps the "both" category increment the global and session counters for certain variables.Threads_running
is a global only variable that is incremented/decremented every begin/end query, and gets a lot of traffic. The old code usedsql.IncrementStatusVariable
to incrementThreads_running
, which was a particularly expensive way to increment a global var because (1) we'd make a new error for every call to the session updater, and (2) the extra map lookup is unnecessary. We don't do the extra map lookup now, and we weren't using the error return so I removed the return variable.Note: this also refactors status variables to be explicitly initializated in the engine
bump/perf here: https://github.com/dolthub/dolt/pull/8189