Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-31609

Send initial values of system variables in first OK packet

Details

    Description

      Currently, all drivers that need to know the values of some system variables must obtain this information by doing a separate SELECT. This adds latency to the connection creation.

      The OK packet that's sent in response to successful authentication could contain initial values of the system variables that are tracked by session_track_system_variables. With this, drivers that support system variable tracking could read these values on startup and avoid the cost of the extra query.

      An extension to this would be to provide some information about the status of the server to the drivers. One example of this would be the Threads_connected status variable that could help drivers that have connection pools to spread the load better if one of the servers in a cluster ends up with more connections than the others.

      Attachments

        Issue Links

          Activity

            ycp Yuchen Pei added a comment - - edited

            Thanks serg, ptal at the updated commits:

            b71adaf94a3 upstream/bb-11.5-mdev-31609 MDEV-31609 Send initial values of system variables in first OK packet
            9fdc953edf3 MDEV-31609 mtr: only print session tracking from the last statement
            

            ycp Yuchen Pei added a comment - - edited Thanks serg , ptal at the updated commits: b71adaf94a3 upstream/bb-11.5-mdev-31609 MDEV-31609 Send initial values of system variables in first OK packet 9fdc953edf3 MDEV-31609 mtr: only print session tracking from the last statement

            b71adaf94a3 and 9fdc953edf3 are ok to push

            serg Sergei Golubchik added a comment - b71adaf94a3 and 9fdc953edf3 are ok to push
            ycp Yuchen Pei added a comment -

            Thanks for the review.

            ramesh: I rebased the commits onto the current 11.5 as the following. ptal thanks:

            ede393c2e93 upstream/bb-11.5-mdev-31609 MDEV-31609 Send initial values of system variables in first OK packet
            82a7c462652 MDEV-31609 mtr: only print session tracking from the last statement
            

            ycp Yuchen Pei added a comment - Thanks for the review. ramesh : I rebased the commits onto the current 11.5 as the following. ptal thanks: ede393c2e93 upstream/bb-11.5-mdev-31609 MDEV-31609 Send initial values of system variables in first OK packet 82a7c462652 MDEV-31609 mtr: only print session tracking from the last statement

            okay to push

            ramesh Ramesh Sivaraman added a comment - okay to push
            ycp Yuchen Pei added a comment -

            Thanks for the testing - pushed the following to 11.5

            e0b6db2de77 upstream/bb-11.5-mdev-31609 upstream/11.5 MDEV-31609 Send initial values of system variables in first OK packet
            e32736ec59c MDEV-31609 mtr: only print session tracking from the last statement
            

            ycp Yuchen Pei added a comment - Thanks for the testing - pushed the following to 11.5 e0b6db2de77 upstream/bb-11.5-mdev-31609 upstream/11.5 MDEV-31609 Send initial values of system variables in first OK packet e32736ec59c MDEV-31609 mtr: only print session tracking from the last statement

            People

              ycp Yuchen Pei
              markus makela markus makela
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.