Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permit skipping metadata for MariaDB #1301

Merged
merged 5 commits into from
Apr 13, 2023
Merged

Permit skipping metadata for MariaDB #1301

merged 5 commits into from
Apr 13, 2023

Commits on Mar 31, 2023

  1. Configuration menu
    Copy the full SHA
    be1d936 View commit details
    Browse the repository at this point in the history
  2. Permit skipping metadata for MariaDB

    Since MariaDB 10.6 (with https://jira.mariadb.org/browse/MDEV-19237) binary result-set skip sending metadata when they haven't changed.
    This avoid network data and parsing client side.
    
    Benchmarks results using DDL:
    ```
    CREATE TABLE test100 (i1 int,i2 int,...,i100 int);
    INSERT INTO test100 value (1,2,...,100);
    ```
    
    test methods:
    ```
        [Benchmark]
        public async Task<int> readOneRow100FieldsAsync()
        {
    	    var total = 0;
    	    using (var cmd = Connection.CreateCommand())
    	    {
    		    cmd.CommandText = "select * FROM test100";
    		    using (var reader = await cmd.ExecuteReaderAsync())
    		    {
    			    while (await reader.ReadAsync())
    				    for (var i = 0; i < 100; i++)
    					    total += reader.GetInt32(i);
    		    }
    	    }
    	    return total;
        }
    
        [Benchmark]
        public async Task<int> readOneRow100FieldsPrepareAsync()
        {
            var total = 0;
            using (var cmd = Connection.CreateCommand())
            {
                cmd.CommandText = "select * FROM test100";
                cmd.Prepare();
                using (var reader = await cmd.ExecuteReaderAsync())
                {
    	            while (await reader.ReadAsync())
    		            for (var i = 0; i < 100; i++)
    			            total += reader.GetInt32(i);
                }
            }
            return total;
        }
    ```
    
    before PR:
    ```
    |                          Method |        Library |      Mean |    Error |
    |-------------------------------- |--------------- |----------:|---------:|
    |        readOneRow100FieldsAsync | MySqlConnector | 104.47 us | 1.468 us |
    | readOneRow100FieldsPrepareAsync | MySqlConnector |  92.49 us | 1.154 us |
    ```
    After PR:
    ```
    |                          Method |        Library |      Mean |    Error |
    |-------------------------------- |--------------- |----------:|---------:|
    |        readOneRow100FieldsAsync | MySqlConnector | 103.99 us | 0.914 us |
    | readOneRow100FieldsPrepareAsync | MySqlConnector |  71.50 us | 1.402 us |
    ```
    
    Signed-off-by: rusher <[email protected]>
    rusher committed Mar 31, 2023
    Configuration menu
    Copy the full SHA
    3b5231d View commit details
    Browse the repository at this point in the history

Commits on Apr 11, 2023

  1. Permit skipping metadata for MariaDB

    Since MariaDB 10.6 (with https://jira.mariadb.org/browse/MDEV-19237) binary result-set skip sending metadata when they haven't changed.
    This avoid network data and parsing client side.
    
    Benchmarks results using DDL:
    ```
    CREATE TABLE test100 (i1 int,i2 int,...,i100 int);
    INSERT INTO test100 value (1,2,...,100);
    ```
    
    test methods:
    ```
        [Benchmark]
        public async Task<int> readOneRow100FieldsAsync()
        {
    	    var total = 0;
    	    using (var cmd = Connection.CreateCommand())
    	    {
    		    cmd.CommandText = "select * FROM test100";
    		    using (var reader = await cmd.ExecuteReaderAsync())
    		    {
    			    while (await reader.ReadAsync())
    				    for (var i = 0; i < 100; i++)
    					    total += reader.GetInt32(i);
    		    }
    	    }
    	    return total;
        }
    
        [Benchmark]
        public async Task<int> readOneRow100FieldsPrepareAsync()
        {
            var total = 0;
            using (var cmd = Connection.CreateCommand())
            {
                cmd.CommandText = "select * FROM test100";
                cmd.Prepare();
                using (var reader = await cmd.ExecuteReaderAsync())
                {
    	            while (await reader.ReadAsync())
    		            for (var i = 0; i < 100; i++)
    			            total += reader.GetInt32(i);
                }
            }
            return total;
        }
    ```
    
    before PR:
    ```
    |                          Method |        Library |      Mean |    Error |
    |-------------------------------- |--------------- |----------:|---------:|
    |        readOneRow100FieldsAsync | MySqlConnector | 104.47 us | 1.468 us |
    | readOneRow100FieldsPrepareAsync | MySqlConnector |  92.49 us | 1.154 us |
    ```
    After PR:
    ```
    |                          Method |        Library |      Mean |    Error |
    |-------------------------------- |--------------- |----------:|---------:|
    |        readOneRow100FieldsAsync | MySqlConnector | 103.99 us | 0.914 us |
    | readOneRow100FieldsPrepareAsync | MySqlConnector |  71.50 us | 1.402 us |
    ```
    
    Signed-off-by: rusher <[email protected]>
    rusher committed Apr 11, 2023
    Configuration menu
    Copy the full SHA
    1119dcc View commit details
    Browse the repository at this point in the history
  2. Merge remote-tracking branch 'rusher/metadataskip' into metadataskip

    # Conflicts:
    #	src/MySqlConnector/Protocol/ProtocolCapabilities.cs
    rusher committed Apr 11, 2023
    Configuration menu
    Copy the full SHA
    fbc4790 View commit details
    Browse the repository at this point in the history
  3. correcting integration test for MySql.Data

    Signed-off-by: rusher <[email protected]>
    rusher committed Apr 11, 2023
    Configuration menu
    Copy the full SHA
    3d62052 View commit details
    Browse the repository at this point in the history