For query which do not change something (which most of the query) I do not see difference:
I make 100000 SELECT 1 and result definitely do not depend on the variable set:
without variables run: 6924 6483 6509 6731
with the variable: 7001 6533 6283 6615
test suite is (with first 2 lines interchangeable of course)
SET session_track_system_variables="";
|
SET session_track_system_variables="autocommit,character_set_client,character_set_connection,character_set_results,time_zone";
|
|
--disable_query_log
|
--disable_result_log
|
let $1= 100000;
|
while ($1)
|
{
|
SELECT 1;
|
dec $1;
|
}
|
--enable_query_log
|
--enable_result_log
|
other extreme case when each execution leads to change:
the same number of SET names:
without variables run: 4739 4721 4744 4700
with the variable: 5120 5340 4873 5124
in this extreme case difference is 7.5% (but I do not think that it is real scenario)
here is test suite for it:
SET session_track_system_variables="";
|
SET session_track_system_variables="autocommit,character_set_client,character_set_connection,character_set_results,time_zone";
|
|
--disable_query_log
|
--disable_result_log
|
let $1= 50000;
|
while ($1)
|
{
|
SET names utf8;
|
SET names latin1;
|
dec $1;
|
}
|
--enable_query_log
|
--enable_result_log
|
revision-id: 10c0278bc08f4e1b179dfcaae8fbfc4c4a0f51c1 (mariadb-10.2.3-76-g10c0278bc08)
parent(s): 9ea0b44c5696d9357465625c3fc9b7f57a856009
committer: Oleksandr Byelkin
timestamp: 2017-01-18 10:40:17 +0100
message:
MDEV-11825: Make session variables TRACKING enabled by default—