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

prepared statements spend a lot of time in cleanup

    XMLWordPrintable

Details

    Description

      With the following patch:

      --- a/mysql-test/main/mysql_client_test.test
      +++ b/mysql-test/main/mysql_client_test.test
      @@ -26,7 +26,7 @@ call mtr.add_suppression(" IP address .* could not be resolved");
       # var/log/mysql_client_test.trace
       
       --exec echo "$MYSQL_CLIENT_TEST" > $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1
      ---exec $MYSQL_CLIENT_TEST --getopt-ll-test=25600M >> $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1
      +--exec $MYSQL_CLIENT_TEST test_mdev_16128 --getopt-ll-test=25600M >> $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1
       
       # End of 4.1 tests
       echo ok;
      --- a/tests/mysql_client_test.c
      +++ b/tests/mysql_client_test.c
      @@ -21053,6 +21053,7 @@ static void test_mdev_16128()
         rc= mysql_stmt_prepare(stmt, query, strlen(query));
         check_execute(stmt, rc);
       
      +for (uint ii=0; ii < 10000; ii++) {
         memset(&bind, 0, sizeof(bind));
         bind.buffer_type= MYSQL_TYPE_STRING;
         bind.buffer_length= strlen(bind_arg_1);
      @@ -21109,6 +21110,7 @@ static void test_mdev_16128()
           executed in PS-mode and bound with the value 'd' returns empty result set.
          */
         DIE_UNLESS(rc == MYSQL_NO_DATA);
      +}
       
         mysql_stmt_close(stmt);
      

      one can verify in the debugger that a new Item_string is allocated on the statement arena for every mysql_stmt_execute.

      This means that memory is growing with every mysql_stmt_execute call and statement cleanup time is proportional to the number of mysql_stmt_execute calls.

      Attachments

        Issue Links

          Activity

            People

              shulga Dmitry Shulga
              serg Sergei Golubchik
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.