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

QUERY CACHE - Query Cache And Autocommit

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 5.1.67, 5.2.14, 5.3.12, 5.5.38, 10.0.12
    • Fix Version/s: 5.3.13, 10.0, 5.5
    • Component/s: None

      Description

      I was using Maria 10.0.10 today and was banging my head against a wall for a few hours trying to figure out why my queries were missing the query cache.

      http://bugs.mysql.com/bug.php?id=42197

      I am working on a legacy PERL project that spawns many short-lived processes that connect to the database and do a single query before exiting.

      my $dsn = "dbi:mysql:database=test";
      my $dbh = DBI->connect($dsn, undef, undef, {RaiseError => 0, AutoCommit => 0});
      
      # 1. Prepare query
      # 2. Executed query (misses cache)
      # 3. Process result
      

      When DBI connects to the SQL server, the first thing it does is issue the "SET" command and then the query comes quickly behind it:

      SET AUTOCOMMIT=0;
      SELECT * FROM test;
      

      When it then executes its query, it misses the query cache every time.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              rspadim roberto spadim added a comment -

              the problem is autocommit and begin are part of flags that make a query unique, check documentation:
              https://mariadb.com/kb/en/mariadb/documentation/optimization-and-tuning/buffers-caches-and-threads/query-cache/

              Show
              rspadim roberto spadim added a comment - the problem is autocommit and begin are part of flags that make a query unique, check documentation: https://mariadb.com/kb/en/mariadb/documentation/optimization-and-tuning/buffers-caches-and-threads/query-cache/

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  belugabehr BELUGABEHR
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated: