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

LP:807198 - Rows_examined can be reset for sub queries

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 5.1.67, 5.2.14
    • None
    • None

    Description

      Rows_examined in the slow query log can be reset by the outer query when using a sub query. For these two queries the first one sets Rows_examined correctly but the second one has it reset even though the row stats work correctly.

      # Time: 110702  9:44:23
      # User@Host: [ebergen] @ localhost []
      # Thread_id: 1  Schema: test  QC_hit: No
      # Query_time: 1.396374  Lock_time: 0.000093  Rows_sent: 1  Rows_examined: 677984
      # Row_Stats: test:rows_read=677984,rows_changed=0,rows_changed_x_indexes=0;
      # Index_Stats: test:rows_read=677984;

      SET timestamp=1309625063;
      select count(*) from t2;

      # Time: 110702  9:44:49
      # User@Host: [ebergen] @ localhost []
      # Thread_id: 1  Schema: test  QC_hit: No
      # Query_time: 2.262701  Lock_time: 0.000126  Rows_sent: 1  Rows_examined: 0
      # Row_Stats: test:rows_read=677984,rows_changed=0,rows_changed_x_indexes=0;#temp#:rows_read=0,rows_changed=677984,rows_changed_x_indexes=677984;
      # Index_Stats: test:rows_read=677984;

      SET timestamp=1309625089;
      select count(*) from (select 1 from t2) as t;

      The table I'm using looks like:

      CREATE TABLE `t2` (
        `t` bigint(20) DEFAULT NULL,
        `u` bigint(20) DEFAULT NULL,
        `b` text,
        KEY `t` (`t`)
      ) ENGINE=InnoDB DEFAULT CHARSET=latin1

      Attachments

        Activity

          People

            Unassigned Unassigned
            ebergen Eric Bergen
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.