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

Wrong estimate of rows in the test case for LP bug #934348

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 5.3.11
    • 5.3.12
    • Optimizer
    • None

    Description

      The following EXPLAIN command from the test case for LP bug #934348

      EXPLAIN
      SELECT a FROM t1 t WHERE a IN (SELECT b FROM t1, t2 WHERE b = a)
      GROUP BY a HAVING a != 'z';

      returns

      id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
      1	PRIMARY	t	index	idx_a	idx_a	4	NULL	1	Using index
      ...

      It should return

      id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
      1	PRIMARY	t	index	idx_a	idx_a	4	NULL	3	Using index

      as the number of rows in the table t1 is equal to 3.

      Attachments

        Activity

          igor Igor Babaev (Inactive) created issue -
          igor Igor Babaev (Inactive) made changes -
          Field Original Value New Value
          Description The following EXPLAIN command from the test case for LP bug #934348

          {code}
          EXPLAIN
          SELECT a FROM t1 t WHERE a IN (SELECT b FROM t1, t2 WHERE b = a)
          GROUP BY a HAVING a != 'z';
          {/code}
          returns
          {code}
          id select_type table type possible_keys key key_len ref rows Extra
          1 PRIMARY t index idx_a idx_a 4 NULL 1 Using index
          ...
          {/code}
          It should return
          {code}
          id select_type table type possible_keys key key_len ref rows Extra
          1 PRIMARY t index idx_a idx_a 4 NULL 3 Using index
          {/code}
          as the number of rows in the table t1 is equal to 3.

          The following EXPLAIN command from the test case for LP bug #934348

          {code}
          EXPLAIN
          SELECT a FROM t1 t WHERE a IN (SELECT b FROM t1, t2 WHERE b = a)
          GROUP BY a HAVING a != 'z';
          {code}
          returns
          {code}
          id select_type table type possible_keys key key_len ref rows Extra
          1 PRIMARY t index idx_a idx_a 4 NULL 1 Using index
          ...
          {/code}
          It should return
          {code}
          id select_type table type possible_keys key key_len ref rows Extra
          1 PRIMARY t index idx_a idx_a 4 NULL 3 Using index
          {/code}
          as the number of rows in the table t1 is equal to 3.

          igor Igor Babaev (Inactive) made changes -
          Description The following EXPLAIN command from the test case for LP bug #934348

          {code}
          EXPLAIN
          SELECT a FROM t1 t WHERE a IN (SELECT b FROM t1, t2 WHERE b = a)
          GROUP BY a HAVING a != 'z';
          {code}
          returns
          {code}
          id select_type table type possible_keys key key_len ref rows Extra
          1 PRIMARY t index idx_a idx_a 4 NULL 1 Using index
          ...
          {/code}
          It should return
          {code}
          id select_type table type possible_keys key key_len ref rows Extra
          1 PRIMARY t index idx_a idx_a 4 NULL 3 Using index
          {/code}
          as the number of rows in the table t1 is equal to 3.

          The following EXPLAIN command from the test case for LP bug #934348

          {code}
          EXPLAIN
          SELECT a FROM t1 t WHERE a IN (SELECT b FROM t1, t2 WHERE b = a)
          GROUP BY a HAVING a != 'z';
          {code}
          returns
          {code}
          id select_type table type possible_keys key key_len ref rows Extra
          1 PRIMARY t index idx_a idx_a 4 NULL 1 Using index
          ...
          {code}
          It should return
          {code}
          id select_type table type possible_keys key key_len ref rows Extra
          1 PRIMARY t index idx_a idx_a 4 NULL 3 Using index
          {code}
          as the number of rows in the table t1 is equal to 3.

          serg Sergei Golubchik made changes -
          Priority Major [ 3 ] Minor [ 4 ]
          serg Sergei Golubchik made changes -
          Fix Version/s 5.3.13 [ 12602 ]
          Fix Version/s 5.3.12 [ 12000 ]
          serg Sergei Golubchik made changes -
          Workflow defaullt [ 25805 ] MariaDB v2 [ 45963 ]
          ratzpo Rasmus Johansson (Inactive) made changes -
          Workflow MariaDB v2 [ 45963 ] MariaDB v3 [ 66649 ]
          serg Sergei Golubchik made changes -
          Assignee Igor Babaev [ igor ]

          It was fixed in 5.3.12, here is the commit message:

          revno: 3612
          revision-id: igor@askmonty.org-20130112042634-peaxz8hj6e32rqln
          parent: wlad@montyprogram.com-20130111114421-j0y44s7tpukn7i9m
          committer: Igor Babaev <igor@askmonty.org>
          branch nick: maria-5.3
          timestamp: Fri 2013-01-11 20:26:34 -0800
          message:
            Fixed bug mdev-4025.
            The bug could lead to a wrong estimate of the number of expected rows
            in the output of the EXPLAIN commands for queries with GROUP BY.
            This could be observed in the test case for LP bug 934348.

          elenst Elena Stepanova added a comment - It was fixed in 5.3.12, here is the commit message: revno: 3612 revision-id: igor@askmonty.org-20130112042634-peaxz8hj6e32rqln parent: wlad@montyprogram.com-20130111114421-j0y44s7tpukn7i9m committer: Igor Babaev <igor@askmonty.org> branch nick: maria-5.3 timestamp: Fri 2013-01-11 20:26:34 -0800 message: Fixed bug mdev-4025. The bug could lead to a wrong estimate of the number of expected rows in the output of the EXPLAIN commands for queries with GROUP BY. This could be observed in the test case for LP bug 934348.
          elenst Elena Stepanova made changes -
          Component/s Optimizer [ 10200 ]
          Fix Version/s 5.3.12 [ 12000 ]
          Fix Version/s 5.3.13 [ 12602 ]
          Assignee Igor Babaev [ igor ]
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Closed [ 6 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 66649 ] MariaDB v4 [ 146323 ]

          People

            igor Igor Babaev (Inactive)
            igor Igor Babaev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.